I use integers as structure keys all the time. But the code below... I don't
know that you can use integers as CF variable names... and why would you
want a key of "001" instead of just "1"?

----- Original Message -----
From: "DeVoil, Nick" <[EMAIL PROTECTED]>


> Am I missing something here?
> Try this
>
> <cfset fred = structNew()>
> <cfset fred["001"] = "freddy">
> <cfloop collection="#fred#" item="idx">
>   <cfoutput>#idx# #fred[idx]#</cfoutput>
> </cfloop>
>
> Then try this
>
> <cfset 001 = "freddy">
> <cfoutput>#001#</cfoutput>
>
> Nick
>
> -----Original Message-----
> From: Simon Horwith [mailto:[EMAIL PROTECTED]]>
>
> By it's simplest definition, a structure keyname is a variable name.  The
> same rules apply to keynames that apply to variable names, and for the
same
> reasons.
>
> ~Simon

> -----Original Message-----
> From: Park, Simon [mailto:[EMAIL PROTECTED]]
>
> What is the reasoning that you can't use integers as keys of structures? I
> understand that arrays might serve this purpose. However, if I am throwing
> the results of a DB query into a complex data structure, I would like the
> use the primary key values, which are often not consecutive, as the
> reference point to the data.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to