Control Structures

From NARS2000
Revision as of 16:29, 16 August 2008 by Sudleyplace (talk | contribs) (New page: <table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary=""> <tr valign="top"> <td><a...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
:for varname :in expr ⋄ ... ⋄ :endfor Loop through the elements of expr assigning each value to varname, and then execute the statements between :for and :endfor.
:goto expr Transfer control to the line number which corresponds to expr.
:if expr ⋄ ... ⋄ :endif Execute the statements between :if and :endif iff expr is 1.
:repeat ⋄ ... ⋄ :endrepeat Repeatedly execute the statements between :repeat and :endrepeat.
:repeat ⋄ ... ⋄ :until expr Repeatedly execute the statements between :repeat and :until until expr is 0.
:return Execute →0.
:select expr1 ⋄ :case expr2 ⋄ ...
⋄ :caselist expr3 ⋄ ... ⋄ :endselect
Execute a specific block of statements depending upon which :case or :caselist expression matches expr1.
:while expr ⋄ ... ⋄ :endwhile Repeatedly execute the statements between :while and :endwhile while expr is 1.
:while expr1 ⋄ ... ⋄ :until expr2 Repeatedly execute the statements between :while and :until while expr1 is 1 and expr2 is 0.