!while, !continue, !done - Conditional loop
!while condition
The !while directive allows statements only to be executed if a condition specified in the directive is met. Every line following the !while directive, until the first !done directive, is only executed if the expression following the !while directive evaluates to a TRUE value.
A !continue may be used in the loop, this immediately returns control to the !while statement and skips the rest of the section.
!while statement may not be nested. That is, only one !while statement may be outstanding at a time, a !repeat(4) statement may be used within the !while to create an inner loop if required. Alternatively the !goto(4) used in conjunction with the !if(4) statement may be used to construct loops.
For example, the following macro segment fills to the fill column with spaces.
!while &less $curcol $fill-col insert-string " " !if &equal %example "1" ; Silly to show continue !continue ; Goto !while !endif ml-write "You wont see me if %example = 1" !done
(c) Copyright JASSPA 1999
Last Modified: 1998/09/03
Generated On: 1999/12/01