Difference between revisions of "While"

From Mesham
Jump to navigationJump to search
m
Line 14: Line 14:
 
  };
 
  };
  
Will loop, each time decreasing the value of variable ''a'' by 1 until the value is too small (0)
+
Will loop, each time decreasing the value of variable ''a'' by 1 until the value is too small (0).
 +
 
 +
''Since: Version 0.41b''
  
 
[[Category:Sequential]]
 
[[Category:Sequential]]

Revision as of 18:12, 13 January 2013

Syntax

while (condition) whilebody;

Semantics

Will loop whilst the condition holds.

Examples

var a:=10;
while (a > 0) {
   a--;
};

Will loop, each time decreasing the value of variable a by 1 until the value is too small (0).

Since: Version 0.41b