!while, !continue, !done - Conditional loop
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 $buffer-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
Copyright (c) 1998-2006 JASSPA
Last Modified: 2006/08/13
Generated On: 2006/10/07