Used with the repeat control structure to specify that the loop is to repeat as long as the specified condition remains true.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
while
# Examples
repeat while the mouse is down
repeat while myVariable is empty
# Description
Use the while keyword to repeat a sequence of instructions as long as a condition continues to be true.
LiveCode evaluates the condition each time the loop repeats, at the top of the loop (before the statements in the repeat structure are executed). If the condition is false, the loop is skipped and execute resumes with the statement after the end repeat statement.
If the condition is already false when LiveCode reaches the repeat statement, the loop is not execute at all.
# Tags
# See
- **keyword:** forever, for, end repeat - **glossary:** keyword, resume, statement, loop, control structure, execute - **control structure:** repeat