J,

Not unusual at all. The pound signs are unneccesary inside cfset (or any
other tag for that matter (unless the value is encapsulated by quotes).

You created a structure in the variables scope and assign value to each
iteration.

Regards,

Phillip B. Holmes

Example of query to structure:

stGetCust=StructNew();
for(IDX=1; IDX LTE qGetCust.recordcount; IDX=incrementvalue(IDX)){
        "stGetCust.#qGetCust.CustomerID[IDX]#.CustomerID" =
qGetCust.CustomerID[IDX];
        "stGetCust.#qGetCust.CustomerID[IDX]#.CompanyName" =
qGetCust.CompanyName[IDX];
        "stGetCust.#qGetCust.CustomerID[IDX]#.ContactName" =
qGetCust.ContactName[IDX];
        "stGetCust.#qGetCust.CustomerID[IDX]#.Phone" = qGetCust.Phone[IDX];
        "stGetCust.#qGetCust.CustomerID[IDX]#.Fax" = qGetCust.Fax[IDX];
         }

========================>




 

-----Original Message-----
From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 12, 2005 2:29 PM
To: CF-Talk
Subject: Re: Weird Problem with Structure

Dave,

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.

Laterz,
J


On Fri, 11 Feb 2005 14:21:48 -0500, Dave Watts <[EMAIL PROTECTED]> wrote:
> 
> "2" is not a valid variable name. If you use dot notation with 
> structures and their members, you must use valid CF variable names for
those members.
> If you want to use arbitrary strings for those members, you must use 
> array
> notation:
> 
> lines["2"]
> 
> 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:194436
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