Re: [Clip] Local Variables and Recursion (Was: Go To Physical Line ...)
- --- In email@example.com, "frank" <tf@...> wrote:
> hello all,
> >> The function calls itself recursively on a smaller version of the
> input (n - > 1) and multiplies the result of the recursive call by n,
> awhile back we discussed here a method to disassemble Clipcode elements
> into modules and then reassemble the modules from within a master clip
> using the FarClip function. I believe the variables could be passed to
> each of the FarClip inclusions as local to the master clip.
> the result was reuseable clipcode pieces operating similar to function
I'm not sure what your point is, but any variables (%varname%) visible
to the local clip is also visible to the far clip, AND vice versa.
The scope is ALWAYS global, UNLESS only the current clip/prcedure can
see a variable, even if the variable is left with a value in it, when
you exit the clip.
On the other hand, if a variable is stored only on disk (or in an INI
file) and you religiously restrict access to the disk file, then
values kept in ^$GetValue type variables DO have a LOCAL scope, rather
than a GLOBAL one.