> Can the CFC access all variables. Scope, ie ones from other pages / cfc's?

unless it's been fixed reciently, it can access FORM and URL (and
probably cookie) scopes too.

I found out by accident that, if you've got an unscoped variable that
doesn;t exist in "variables" or "this" scope, it'll "walk down the
scope tree" looking for it...all the way to FORM and URL...

On 7/28/06, Mark Mandel <[EMAIL PROTECTED]> wrote:
>
> 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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to