Aidan, I usually do what you're doing, but I'll just duplicate() so that I have a fresh local copy, and then update the data in that and commit changes back to shared scope afterwards simply by duplicating back and overwriting that shared scope struct.
eg, I'll store everything in session.user for a user (simple vars, structs, arays, queries etc) and then simply do request.user = duplicate(session.user) to grab the whole lot, or for instance, request.user.history = duplicate(session.user.history) for specific bits. if anything has changes at the end of that template's request, do a session.user = duplicate(request.user). If I remember correctly though, complex vars within complex vars might not be properly duplicated, but passed by reference. Can anyone correct me on this, as it may have been nixed by an upgrader. Rich > -----Original Message----- > From: Aidan Whitehall [mailto:[EMAIL PROTECTED] > Sent: 15 September 2003 13:22 > To: [EMAIL PROTECTED] > Subject: RE: [ cf-dev ] complex variables passed to functions as... > > > > why would you want to do a StructCopy? > > > > surely... application.database[""] or application.database.foo would > do? > > Yeah, if you only wanted to access one of the variables in the > structure, but there are several instances where I want a handful. > Rather than just assign those to a range of local variables, > it's easier > just to lock the application variable properly and copy the entire > structure. > > > I think in these situations its probably best to throw them into the > request > > scope. > > The request scope has become so heavily populated that I was > moving some > of the less frequently referenced request scope structures into the > application scope. > > > -- > Aidan Whitehall <mailto:[EMAIL PROTECTED]> > Macromedia ColdFusion Developer > Fairbanks Environmental Ltd +44 (0)1695 51775 > Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards> > > ______________________________________________________________ > __________ > This e-mail has been scanned for all viruses by Star Internet. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > ______________________________________________________________ > __________ > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
