yup.

chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com



-----Original Message-----
From: Steve Vosloo [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 4:04 AM
To: CF-Talk
Subject: RE: Referencing an array item


So, to access a element [2][1] in the 3rd array I would have:

Application.SM[3][2][1]

?



> -----Original Message-----
> From: Christopher Olive, CIO [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 5:49 PM
> To: CF-Talk
> Subject: RE: Referencing an array item
>
>
> well, you collapse the three arrays into an "uber" array, called SM.  so
> your original statement might be..
>
> <CFSET Application.SM = ArrayNew()>
> <cfset Application.SM[1] = SM1>
> <cfset Application.SM[2] = SM2>
> <cfset Application.SM[3] = SM3>
>
> then use your number as an index into your outer array.
>
> chris olive, cio
> cresco technologies
> [EMAIL PROTECTED]
> http://www.crescotech.com
>
>
>
> -----Original Message-----
> From: Steve Vosloo [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 29, 2001 2:21 AM
> To: CF-Talk
> Subject: RE: Referencing an array item
>
>
> But I have 3 arrays, so it will really need to look like:
>
> Application.SM1[n][element]
> Application.SM2[n][element]
> Application.SM3[n][element]
>
> I can't see how else to work around this.
>
>
>
> > -----Original Message-----
> > From: Christopher Olive, CIO [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 28, 2001 8:31 PM
> > To: CF-Talk
> > Subject: RE: Referencing an array item
> >
> >
> > ray has an excellent point.  however, why not exploit the nature
> > of arrays?
> > if you make Application.Sm an array with three elements, each one
> > the arrays
> > sm1..3, then you can reference an element in SM(n) by
> > Application.SM[n][element].  you don't have to futz with string
> evaluation
> > at all.
> >
> > chris olive, cio
> > cresco technologies
> > [EMAIL PROTECTED]
> > http://www.crescotech.com
> >
> >
> >
> > -----Original Message-----
> > From: Steve Vosloo [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 28, 2001 8:41 AM
> > To: CF-Talk
> > Subject: Referencing an array item
> >
> >
> > 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
> > Fax: (+27) 21 674 4549
> >
> > Email: [EMAIL PROTECTED]
> > Website: www.vardus.com
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to