Yes, I could. I went off into the wrong direction on this one from the
start. Is there a way to do it with the arrays so I don't have to write the
thing over again?

-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 3:39 PM
To: CF-Talk
Subject: RE: dynamically naming arrays


Why not just use structures? If Application.Chat was a structure, you
could easily add dynamic values to it by using bracket notation.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : [EMAIL PROTECTED]
Yahoo IM : cfjedimaster

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 05, 2002 3:26 PM
> To: CF-Talk
> Subject: dynamically naming arrays
>
>
> In the following code I am trying to make the application.users and
> application.chat arrays dynamically named.
>
> I have a variable called variables.currentroomid which I
> would like to be
> appended to the application.chat and application.users arrays
> like this
> application.chatX where x is the variables.currentroomid variable.
>
> How can I do this?
>
> <CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY"
> SCOPE="SESSION">
>       <CFIF ISDEFINED('SESSION.CHATUSERNAME')>
>               <CFSET ENTERROOM = "">
>       <CFELSE>
>               <CFSET ENTERROOM = "ENTERS ROOM">
>       </CFIF>
> </CFLOCK>
> <CFPARAM NAME="FORM.CHAT" DEFAULT="#VARIABLES.ENTERROOM#">
> <CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY"
> SCOPE="APPLICATION">
>       <CFIF NOT ISDEFINED('APPLICATION.USERS')>
>               <CFSET APPLICATION.USERS=ARRAYNEW(1)>
>       </CFIF>
> </CFLOCK>
> <CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY"
> SCOPE="APPLICATION">
>       <CFIF NOT ISDEFINED('SESSION.CHATUSERNAME')>
>               <CFSET
> SESSION.CHATUSERNAME=UCASE(TRIM(GETMEMBERNAME.USERNAME))>
>               <CFSET
> ARRAYAPPEND(APPLICATION.USERS,SESSION.CHATUSERNAME)>
>       </CFIF>
> </CFLOCK>
> <CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY"
> SCOPE="APPLICATION">
>       <CFIF NOT ISDEFINED('APPLICATION.CHAT')>
>               <CFSET APPLICATION.CHAT=ARRAYNEW(1)>
>               <CFSET ARRAYAPPEND(APPLICATION.CHAT,'')>
>       </CFIF>
> </CFLOCK>
> <CFLOCK TIMEOUT="10" THROWONTIMEOUT="No" TYPE="READONLY"
> SCOPE="APPLICATION">
>       <CFSET
> ARRAYAPPEND(APPLICATION.CHAT,"<B>"&SESSION.CHATUSERNAME&" :</B>
> "&FORM.CHAT)>
> </CFLOCK>
>
>

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to