Treat session scope like a structure.
Then insert with StructInsert(session, "variable_#ndx#", someValue)
and display with StructFind(session, "variable_#ndx#").
Better yet. Make a structure inside session scope, like this
<cfset session.myVariables = StructNew()>
Then insert like this:
<cfset session.myVariables[ndx] = someValue>
And loop like this:
<cfloop collection="#session.myVariables#" item="i">
#session.myVariables[i]#
</cfloop>
As easy as that.
PS: And don't forget to <cflock> all session scope variable access!
-erki
----- Original Message -----
From: "Mark Smyth" <[EMAIL PROTECTED]>
To: "CF-Server" <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 3:01 PM
Subject: RE: Variables
> hi herman
>
> i think if you look at the evaluate function you'll find what you're
looking
> for
>
> hth
> mark
>
> -----Original Message-----
> From: Herman Cremer [mailto:[EMAIL PROTECTED]]
> Sent: 25 October 2001 13:56
> To: CF-Server
> Subject: Variables
>
>
> 'elo list.
>
> I wonder if anyone can help.
>
> I am trying to set up 10 session variables.
> Like so:
>
> <CFLOOP From="1" To="10" Index="ndx">
> <CFSET Session.Variable_#ndx# = Form.FormField>
> </CFLOOP>
>
>
> And then display them.
> like so:
> <CFLOOP From="1" To="10" Index="ndx">
> #Session.Variable_#ndx##
> </CFLOOP>
>
> This code does not work, but its just to give you an idea of what I am
> trying to do.
> My question...Can one use on variable as part of another ?!?! -if this
makes
> sense.-
>
> Another example:
> Is this possible ?
>
> <CFSET x = "var1">
> <CFSET MyVar#var1# = "a value">
>
> Any suggestions welcome.
>
> Herman Cremer
> South Africa.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com