This content has been marked as final. Show 7 replies
VARed variables do not reside in anything that is exposed as a scope.
Why? God only knows.
However they're all hiding away in here:
Strange but true.
I don't think it has a scope. If it came from a function parameter then you could you arguments.arguementname but a simple set inside a function is only executable when you invoke the function and therefore doesn't exist at all when it isn't called. Are you having problems with the same variable name or something? Try changing your variable names
If you wanted y to equal x you would just put :
I was just wanting to know if there is an actual scope name for the local variables inside a function which you can use as a prefix.
I was also under the misconception that there was no "local" scope but that the first checked level is "Variables", but this is apparently not the case, the
CF 7.0 Documentation lists the scopes correctly.
Still curious if there is a way to reference the local variable explicitly.
Other than the way I suggested three comments further up, you mean?
No. Other than that way, there is no other way that I'm aware of.
@Adam. I won't use that code in production, because Adobe/Macromedia might decide to change things behind the scenes, but still it is very handy for debugging. Thanks!
I'm not sure but I've heard that if you use MachII then you should put all functions' variables to var because it may cause you a trouble (Coldfusion may take your variable from "variables" scope from other instance of the component).
If somone can confirm it or deny - please do it ;-)
> @Adam. I won't use that code in production, because Adobe/Macromedia might decide to change things behind the scenes, but still it is very handy for debugging. Thanks!
It's a CF function. It's no more likely to change than the behaviour of
left() or listFind().