This is new in CFMX. If you use dot notation CFMX assumes you are
referencing a structure and creates it if it doesn't exist. CF5 and
prior would create a simple variable in the local scope with a dot in
it.

http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/arrayStruct7.htm



On Fri, 14 Jan 2005 13:17:29 -0600, Jared Rypka-Hauer - CMG, LLC
<[EMAIL PROTECTED]> wrote:
> I was recently testing something and made an interesting discovery...
> 
> <cfscript>
>   thisVar.testStruct.myVal = "some value";
> </cfscript>
> 
> Actually works... without a structNew() call to create it.
> 
> So... new question... do we go ahead and imply a struct simply by
> syntax, or do we, for the sake of protocol and readability, insist on
> an explicit strucNew() call?
> 
> Personally, I'm for dropping the extra operation and implicity
> creating a struct.
> 
> Anybody?
> 
> Laterz,
> J
> 
> --
> Continuum Media Group LLC
> Burnsville, MN 55337
> http://www.web-relevant.com
> http://cfobjective.blogspot.com
> 
> On Fri, 14 Jan 2005 13:58:04 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> > Associative arrays in PHP are basically the equivalent of structures in
> > CF.  So, in CFSCRIPT...
> >
> > item = structnew();
> > item.level = "level 12";
> > item.ecs = "something else";
> > // alternate syntax
> > item["dn"] = "third data";
> >
> > and so forth.
> >
> > --Ben
> >
> > Charles Heizer wrote:
> > > 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,
> > >       );
> >
> >
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:190722
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to