FUNCTION:STRUCTNEW
last edited by
markdrew
on 26-May-2010
Contents |
StructNew
Description
Creates a structure. If you pass in a parameter you can create a normal, weak or linked typed of structure.
You can create a specific structure by passing a variable into this function for example:
- "normal" (default): This creates a standard structure.
- "weak": this creates a "weak" structure. This is good for caching objects as it is memory aware and will garbage collect objects. You should check if the key exists before obtaining a value from it.
- "linked": this creates a "linked" structure. This is good for ordered structures. When you loop through the struct, it will return the keys in the order that they were added to the structure.
Category
Other
Implemented
Usage Syntax
StructNew([type])
Return Information
| Return Type | Return Description |
| struct |
Arguments
| Name | Type | Required | Position | Default | Description |
| type | String | No | 1 | the type the new struct (normal,weak,linked) |
Example Usage
<cfset myStructure = StructNew()> <cfset myLinkedStructure = StructNew("linked")> <cfset myWeakStructure = StrucNew("weak")>
SideBar
User Login
Comments (