>- see footer for list info -<
I scrapped using arrays and changed it all to struct keys instead, I think
that may have solved it without having to change the syntax.

Russ 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian
Sent: 04 June 2007 17:39
To: Coldfusion Development
Subject: Re: [CF-Dev] FW: CFGURU: weird variable behaviour

>- see footer for list info -<
My guess is that when setting the range of array values to StructNew(), all
the array elements are getting a reference to the same struct.


On 02/06/07, Snake <[EMAIL PROTECTED]> wrote:
>
> >- see footer for list info -<
>
>
> ok in my onRequeststart I have this to initialise my session scope
>
> <cfparam name="session.step" default="#ArrayNew(1)#"> <cfif
> ArrayLen(session.step) LT application.totalsteps>
>    <cfset ArraySet(session.step, 1, application.totalsteps, 
> StructNew())> </cfif>
>
> And in each step of my application I will populate the appropriate 
> structure in the appropriate array index.
> But I have this very odd behavior that CF is setting the values or 
> more than one array index.
>
> e.g. I may have this
>
> <cfset session.step[5].foo =1>
>
> but every array index from 5 onwards will also have that value set as 
> well.
> E.g. it is as if I did this
> <cfset session.step[5].foo =1>
> <cfset session.step[6].foo =1>
> <cfset session.step[7].foo =1>
>
> it only seems to happen if the struct is currently empty though.
> --
> --
> Russ Michaels
>
>
> _______________________________________________
>
> For details on ALL mailing lists and for joining or leaving lists, go 
> to http://list.cfdeveloper.co.uk/mailman/listinfo
>
> --
> CFDeveloper Sponsors:-
> >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
> >- Lists hosted by www.Gradwell.com -<
> >- CFdeveloper is run by Russ Michaels, feel free to volunteer your 
> >help
> -<
>
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help 
>-<


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to