Structget - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

StructGet

Description
Gets a structure(s) from a specified path.
Returns
An alias to the variable in the pathDesired parameter. If necessary,
arrays to make pathDesired a valid variable "path."
Category
Structure functions
Function syntax
StructGet(pathDesired)
See also
Structure functions
History
ColdFusion MX:
Changed behavior: this function can be used on XML objects.
Changed behavior: if there is no structure or array present in oathDesired, this function creates
structures or arrays to make pathDesired a valid variable "path."
Parameters
Parameter
pathDesired
Usage
You can inadvertently create invalid structures using this function. For example, if array notation
is used to expand an existing array, the specified new element is created, regardless of the type
currently held in the array.
Example
<!--- GetStruct() test --->
<cfset test = StructGet( "dog.myscope.test" )>
<cfset test.foo = 1>
<cfif NOT IsDefined("dog")>
Dog is not defined<br>
</cfif>
<cfif NOT IsDefined("dog.myscope")>
Dog.Myscope is not defined<br>
</cfif>
<cfif NOT Isdefined("dog.myscope.test")>
Dog.Myscope.Test is not defined<br>
</cfif>
<cfif NOT Isdefined("dog.myscope.test.foo")>
Dog.Myscope.Test.Foo is not defined<br>
</cfif>
<cfoutput>
#dog.myscope.test.foo#<br>
Description
Pathname of variable that contains structure or array from which ColdFusion
retrieves structure.
creates structures or
StructGet
StructGet
703

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents