I am very much into descriptive programing as well and showing your
intent in your code, stuctnew() does this for you. If you are leaving
stuctnew() out for efficiency, I wouldn't worry about it, even 100
stuctnew()'s aren't going to make much of a dent in processing
time....also I beleive in versions previous to MX you have to use
structnew().


Adam H


On Fri, 14 Jan 2005 21:52:10 -0000, Adrian Lynch
<[EMAIL PROTECTED]> wrote:
> I only did it cos it looked closer to your php code. Ben did it cos cfscript
> bribed him! :OD
> 
> Ade
> 
> -----Original Message-----
> From: Charles Heizer [mailto:[EMAIL PROTECTED]
> Sent: 14 January 2005 20:40
> To: CF-Talk
> Subject: Re: Multivalued Array help
> 
> Ok, great.
> 
> I have noticed in the two responses to my question both of you
> mentioned using cfscript. Is there an advantage to using cfscript vs.
> using cfset  and declaring structure?
> 
> Thanks,
> - Charles
> 
> On Jan 14, 2005, at 11:06 AM, Adrian Lynch wrote:
> 
> > You'd use a structure, arrays in CF are indexed with intergers,
> > structure
> > have character keys.
> >
> > <cfscript>
> >       item = StructNew();
> >       item.level = level;
> >       item.ecs = expanded;
> >       item.dn = dn;
> >       item.rdn = rdn[1];
> >       item.icon = icon;
> > <cfscript>
> >
> > <!--- Have a look at the item --->
> > <cfdump var="#item#">
> >
> > If you want to preserve the case of the struct keys, user item["level"]
> > syntax instead.
> >
> > Ade
> >
> > -----Original Message-----
> > From: Charles Heizer [mailto:[EMAIL PROTECTED]
> > Sent: 14 January 2005 18:50
> > To: CF-Talk
> > Subject: Multivalued Array help
> >
> >
> > Hello,
> > If I wanted to do a multi-valued array in php I would initialize the
> > array like this, how would I do this in ColdFusion?
> >
> > Thanks,
> > - Charles
> >
> > PHP Example --
> > $item = array(
> >                 'level'=> $level,
> >                 'ecs' => $expanded,
> >                 'dn'=> $dn,
> >                 'rdn'=> $rdn[0],
> >                 'icon'=> $icon,
> >       );
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware: a new and convenient web-based time tracking application. Start 
tracking and documenting hours spent on a project or with a client with Logware 
today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190696
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to