Well - it's a little short - but not as short as it could be.

You can do a ValueList() to turn any column into a List then use
ListToArray() to get the array.

It's not pretty, but it's only two functions and it works.  ;^)

Jim Davis

> -----Original Message-----
> From: Stacy Young [mailto:Stacy.Young@;sfcommerce.com] 
> Sent: Thursday, November 14, 2002 12:50 AM
> To: CF-Talk
> Subject: RE: Query Column as an Array
> 
> 
> Thanks Jim...was hoping there was a short hand way to grab an 
> entire column as an array.
> 
> Stace 
> 
> -----Original Message-----
> From: Jim Davis [mailto:jim@;depressedpress.com] 
> Sent: Thursday, November 14, 2002 12:43 AM
> To: CF-Talk
> Subject: RE: Query Column as an Array
> 
> > My brain seems to have shut down on me here...isn't there a
> > way to reference a query column as an array?
> 
> Although CF seems to treat each column as an array you can't 
> reference one as an array directly (as in 
> ArrayLen(Query.Colname) ).  (At least this was the case - I 
> haven't actually checked MX yet...)
> 
> However you can access the data using array notation in two styles:
> 
> 1) MyQuery.MyColumn[Row]
> 
> This is a mixture of Array and dot notation.  Where "Row" is 
> an integer representing the row that you want.
> 
> 2) MyQuery["MyColumn"][Row]
> 
> This is "full" array notation.  "MyColumn" is a string 
> representing a column name and "Row" is the same as above.
> 
> In both cases the values in brackets can be variables.
> 
> The difference is that with a true Array using method two you 
> would only need a number for both values.  With a query it 
> must a string however.
> 
> Hope this helps,
> 
> Jim Davis
> 
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to