Just to throw out another solution, you can get the same result you
initailly tried by doing the following:

<cfloop query="getcs">
     <cfset variables["row"&getcs.currentRow] = getcs.cscount />
</cfloop>

On Thu, May 28, 2009 at 7:58 AM, Peter Boughton <bought...@gmail.com> wrote:
>
>> I need to store every row
>> into a different distinct variable.
>
> You probably don't, and should instead be using an array.
>
>
> MyValues = ListToArray( ValueList( MyQuery.ColumnName ) )
>
> Then you can do MyValues[1] to MyValues[9] to get at the variables.
>
>
> If you *really* need to create individual variables, you can then do:
>
> <cfloop index="i" from="1" to="#ArrayLen(MyValues)#">
>    <cfset Variables['MyVariable#i#'] = MyValues[i] />
> </cfloop>
>
> But don't do that - use the array.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322860
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to