Have you tried something like this


<cfloop query="qTopItems">
    <cfset setVariable( "application.Array_" & qTopItems.ID, arraynew(1)
)>
</cfloop>


Qasim

-----Original Message-----
From: David Robinson [mailto:[EMAIL PROTECTED]
Sent: Friday, March 26, 2004 5:36 PM
To: CF-Talk
Subject: Naming application-scoped variables from within a loop

The following code works fine to create a set of arrays: Array_1,
Array_2,
etc.

<cfloop query="qTopItems">
    <cfset ChildArray = "Array_" & #qTopItems.ID#>
    <cfset ChildArray = ArrayNew(1)>
</cfloop>

But I can't figure out how to create that group of arrays as
application-scoped objects.
How would I go about creating objects so that I end up with
application.Array_1, application.Array_2, etc. ?

I have tried:

<cfloop query="qTopItems">
    <cfset ChildArray = "application.Array_" & #qTopItems.ID#>
    <cfset ChildArray = ArrayNew(1)>
</cfloop>

which creates arrays, but not in the application scope. The
<cfapplication>
tag is working fine - I have other application variables - my problem is
with using some variable in building the name of an application
variable.  I
must be missing something, probably something pretty obvious.  Any help
would be greatly appreciated.

Dave
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to