Lingo Dictionary > D-F > exit repeat |
![]() ![]() ![]() |
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 conditionsuch as two values being equal or a variable being a certain valueexists.
Example
This 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
![]() ![]() ![]() |