Putting "" into variables

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Putting "" into variables

Post by bjb007 » Sat Aug 23, 2008 6:03 am

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?
Life is just a bowl of cherries.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Sat Aug 23, 2008 6:08 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”