|
Case Statement Overview
The following is a simple example of a case statement:
case (the key) of
"A" : go to frame "Apple"
"B" : go to frame "Ball"
"C" : go to frame "Car"
otherwise
beep
end case
Lingo compares the value of the function the key in the first line to the values at the beginning of the following lines. The comparison starts with the second line and proceeds downward until Lingo finds a match. Lingo executes the statement or statements that appear after the matching value. When no other matches are found, Lingo executes the otherwise statement. For example, the statement above jumps to the frame "Ball" if you pressed the "B" key. When you press any other key besides "A", "B", or "C", Lingo executes the otherwise statement and beeps.
|