Ok, Cool. Didn't realise that the cfc could access all the other suff in variables. Just thought it could access stuff it created.
I'll have a play with this. PS: I'm assuming that instance is something you need to create ie in the init <cfset variables.instance = structNew() /> Regards Dale Fraser http://dale.fraser.id.au -----Original Message----- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark Mandel Sent: Friday, 28 July 2006 13:53 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: variables.instance On 7/28/06, Dale Fraser <[EMAIL PROTECTED]> wrote: > > Mark, > > But I thought that the variables scope was only accessible to the CFC that > you're using it in. Why then would you need to worry? This is true, but maybe I didn't explain myself properly. If I wanted to make a copy of the values in a CFC (assuming all it has is basic types of values in the instance struct) having the instance struct allows me to do this: (in cfscript'ish for ease) function getMemento() : Struct { return duplicate(variables.instance); } And it is very easy. There is no way I could go duplicate(variables), as the variables scope has reference to LOTS of things - including UDFS that are set to that CFC, the 'this' scope, and various other pieces. It's more of a personal preference thing. I like it because it keeps things separate, and I don't have to worry about overlap. > > Can the CFC access all variables. Scope, ie ones from other pages / cfc's? It can access shared scopes (application, session etc), although getting to those from a CFC is another design discussion. That make a bit more sense? -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ICQ: 3094740 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---