User Guide
Chapter 16404
To clear all current global variables:
• Use the clearGlobals command in the Message window to set the value of all global variables
to VOID.
See
global, clearGlobals, and showGlobals in the Lingo Dictionary.
To monitor the values of global variables during movie playback, use the Object inspector. See
“Using the Object inspector” on page 433.
Using local variables
A local variable exists only as long as the handler in which it is defined is running. However, after
a local variable is created, you can use the variable in other expressions or change its value while
Lingo is still within the handler that defined the variable.
Treating variables as local is a good idea when you want to use a variable only temporarily in one
handler. This helps you avoid unintentionally changing the value in another handler that uses the
same variable name.
To create a local variable:
• Assign the variable a value using the equals (=) operator or the set variableName = value
command.
Unless the handler uses the term
global to declare that a variable is global, the variable is
automatically a local variable.
To display all current local variables in the handler:
• Use the showLocals command.
You can use this command in the Message window or in handlers to help with debugging. The
result appears in the Message window.
To monitor the values of local variables during movie playback, use the Object inspector. See
“Using the Object inspector” on page 433.
Expressing literal values
A literal value is any part of a statement or expression that is to be used exactly as it is, rather than
as a variable or a Lingo element. Literal values that you encounter in Lingo are character strings,
integers, decimal numbers, cast member names and numbers, frame and movie names and
numbers, symbols, and constants.
Note: The value() function can convert a string into a numerical value. The string() function can convert a
numerical value into a string.
Each type of literal value has its own rules.