I figured the answer would be similar.  In my actual use I need to loop over
a query without knowing what the columns are, so I use the
recordset.columnlist in my list loop.  That's why I created the structure
with testquery[i], so I could approximate query["foo"].

So if I say testquery[1], don't I still need to supply the columnname
somehow to get at the values?  Would that be testquery[1].foo?  If it is,
how would I approximate that without knowing what "foo" actually is at
runtime?

-Patti

Raymond Camden wrote:

> Patti, it has been my experience that whenever you use bracket notation
> with a query, you must specify the row number as well. If you changed
> testquery[i] to testquery[1] the code should work as you want. I don't
> believe this is really a bug per se, just a usage case. (Although you
> could say that if query.foo always equals run one, then query["foo"]
> should as well.
> 
> =======================================================================
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> 
> Email    : [EMAIL PROTECTED]
> WWW      : www.camdenfamily.com/morpheus
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda
> 
>> -----Original Message-----
>> From: Patti G. L. Hall [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, January 15, 2003 12:06 AM
>> To: CF-Talk
>> Subject: Try this code: WDDX problem recreated
>> 
>> 
>> Regarding my previous message, I managed to recreate the wddx
>> serialization problem I was experiencing.  Run this code.  It
>> should show you what I was talking about.
>> 
>> I'll be reporting this using the wishlist form, of course.
>> Just wanted to post it in case anyone else was interested.
>> 
>> [cfscript]
>>             // Fabricate a query
>>             testQuery = querynew('age,gender,race');
>>             queryaddrow(testQuery);
>>             querysetcell(testquery, 'age', 12,1);
>>             querysetcell(testquery, 'gender', 'Male',1);
>>             querysetcell(testquery, 'race', 'Black',1);
>> 
>>             maindata = structnew();
>> [/cfscript]
>> 
>> [cfdump var="#testQuery#"]
>> 
>> [!--- Turn query into structure---]
>> [cfloop index="i" list="age,gender,race"]
>>             [cfset structinsert(mainData, i, testquery[i])] [/cfloop]
>> 
>> [cfdump var="#maindata#"]
>> [cfwddx action="cfml2wddx" input="#maindata#"
>> output="wddxdata"] [cfdump var="#wddxdata#"]
>> 
>> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to