User Guide

223
Assuming that exitLock is set to TRUE, nothing occurs automatically when the Control+period/
Q/W, Esc, or Command+period/Q/W keys are used. This handler checks keyboard input for keys
to exit and takes the user to a custom quit sequence:
on checkExit
if the commandDown and (the key = "." or the key = "q") and the exitLock =
TRUE then go to frame "quit sequence"
end
exit repeat
Syntax
exit repeat
Description
Keyword; instructs Lingo to leave a repeat loop and go to the statement following the end
repeat
statement but to remain within the current handler or method.
The exit repeat keyword is useful for breaking out of a repeat loop when a
specified condition—such as two values being equal or a variable being a certain value—exists.
Example
The following handler searches for the position of the first vowel in a string represented by the
variable
testString. As soon as the first vowel is found, the exit repeat command instructs
Lingo to leave the repeat loop and go to the statement
return i:
"on findVowel testString
repeat with i = 1 to testString.char[testString.char.count]
if ""aeiou"" contains testString.char[i] then exit repeat
end repeat
return i
end"
See also
repeat while, repeat with
exp()
Syntax
(integerOrFloat).exp
exp(integerOrFloat)
Description
Function; calculates e, the natural logarithm base, to the power specified by integerOrFloat.
Example
The following statement calculates the value of e to the exponent 5:
put (5).exp
-- 148.4132