Whenever possible, don't use Evaluate, it's not that fast. In this case,
SM1, SM2, are keys in the application scope. It is faster, and easier to
read, to just do:

<CFSET Len = ArrayLen(Application["SM#Attributes.Num#"]>

p.s. Don't forget the read lock!

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

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

> -----Original Message-----
> From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 28, 2001 8:50 AM
> To: CF-Talk
> Subject: Re: Referencing an array item
>
>
> Once again, Evaluate to the rescue:
>
> #ArrayLen(Evaluate("application.SM & attributes.Num"))#
>
> OR
>
> #ArrayLen(Evaluate("application.SM#attributes.Num#"))#
>
> > I have 3 arrays, which are assigned to the application scope:
> >
> > <cfset Application.SM1 = SM1>
> > <cfset Application.SM2 = SM2>
> > <cfset Application.SM3 = SM3>
> >
> > My custom tag receives a number (1,2 or 3), and with that I
> reference the
> > correct array. I need to dynamically use this number to reference the
> > correct array, e.g.
> >
> > #ArrayLen(application.SM & attributes.Num)#
> >
> > (The above code does not work.) Any help would be much
> appreciated!! Thanks
> > in advance.
> >
> > Steve
> >
> >
> > Development Manager
> > Vardus Internet Solutions (SA)
> >
> > Tel: (+27) 21 670 9880


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to