CFLib.org – Common Function Library Project

struct([paramN])

Last updated August 22, 2007

author

Erki Esken

Version: 2 | Requires: CF6 | Library: DataManipulationLib

Description:
Now you can make simple or complex structures with a one-liner in CF, just like with built-in shorthand syntax in many other programming languages. You can create simple structures with ease, or nest Struct() functions to create complex, nested structures.

Return Values:
Returns a structure.

Example:

<cfdump var="#Struct(foo='bar',bar='foo',quux=Struct(one='1',two='2',three='3'))#">

Parameters:

Name Description Required
paramN This UDF accepts N optional arguments. Each argument is added to the returned structure. No

Full UDF Source:

/**
 * This functions helps to quickly build structures, both simple and complex.
 * v2 by Brendan Baldwin brendan.baldwin@gmail.com
 * 
 * @param paramN      This UDF accepts N optional arguments. Each argument is added to the returned structure. (Optional)
 * @return Returns a structure. 
 * @author Erki Esken (erki@dreamdrummer.com) 
 * @version 2, August 22, 2007 
 */
function struct() { return duplicate(arguments); }

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson