Control Structures

From NARS2000
Revision as of 09:29, 16 August 2008 by Sudleyplace (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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.