August 2003
Intermediate to advanced
1140 pages
68h 45m
English
SetVariable
SetVariable(variablename, value)Assigns value to
variablename where
value is any passed value.
SetVariable( ) is useful when you want to create
dynamically named variables. The following example uses
SetVariable( ) to assign values to several
dynamically created variables:
<cfloop index="index" from="1" to="10">
<cfset ValueOfVariable = SetVariable("MyVar#index#", #Index#)>
</cfloop>
<cfloop index="pos" from="1" to="10">
<cfoutput>MyVar#pos# = #Evaluate("MyVar"&"#pos#")#<br></cfoutput>
</cfloop>