Page 1 of 1
Putting "" into variables
Posted: Sat Aug 23, 2008 6:03 am
by bjb007
My scripts have a lot of variables
which I want to set to "" from a
"Reset" button.
I've done this so far by listing them
individually but wonder if there's an
easier way - does Rev have a list of
variables I can access?
Posted: Sat Aug 23, 2008 6:08 am
by Janschenkel
From the documentation entry of the 'variableNames' local property:
Use the variableNames function to find out which sources of value are available to the current handler, or to see whether a variable name is available for use.
Value:
The variableNames function returns a value consisting of four lines:
1. Parameters passed to the current handler (including leading '@' for parameters passed by-reference)
2. Local variables created in the current handler
3. Local variables created in the current script but outside all handlers
4. Global variables
Within each line, the variable or parameter names are separated by commas.
You'll probably want to intruduce a naming scheme for your global variables, and make sure not to wipe any other global variables - which is the polite thing to do in an environment where every script can modify any global variable
Also see its friends 'globalNames' and 'localNames' to see which one narrows it down best for you.
Hope this helped,
Jan Schenkel.