Pardon the typo:

 sed 's/unneccesary/unnecessary/'

;)

Regards,

Phillip B. Holmes
 

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 12, 2005 3:41 PM
To: CF-Talk
Subject: RE: Weird Problem with Structure

> I had an interesting thing happen the other day. I was messing around 
> with something, trying to find a way around a particular problem, and 
> I used this code... fully expecting it to error out:
> 
> <cfset myTest = structNew()>
> 
> <cfloop from="1" to="5" index="i">
>      <cfset myTest[i] = "some text, whatever was in the array I was 
> actually looping."
> </cfloop>
> 
> Now, had I put myTest["#i#"], I would have expected it to work. What I 
> ended up with when I dumped it was a struct that looked very much like 
> an array.
> 
> This was on CFMX 6.1, just kinda struck me odd.

Actually, that makes perfect sense.

When you use array notation, you can specify whatever values you like. Since
CF is a typeless language, any value stored within a variable will be
treated as a string when you use array notation to make it a member name for
a structure.

Keep in mind that the two values of foo are the same in the example below:
<cfset i = 1>
<cfset foo = "#i#">
<cfset foo = i>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized instruction
at our training centers in Washington DC, Atlanta, Chicago, Baltimore,
Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:194439
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to