while

Syntax while expression

statements

Action Evaluates expression. As long as it evaluates to true, the loop statements are executed, and expression is re-evaluated.

Examples while scratchpad.x < 0
if not dialog.getInt ("Enter a positive number:", @scratchpad.x)

return (false)

This loop repeats until the user enters a positive value for scratchpad.x or cancels the dialog. Note that the dialog will never be presented if scratchpad.x is already greater than zero.

while window.frontmost () != ""
window.hide (window.frontmost ())

This loop hides all of the open windows, including the Main Window.

Notes If expression initially evaluates to false, the loop body will not be executed even once.

See Also for

loop

break

continue

Discuss