WHILE: Difference between revisions
Jump to navigation
Jump to search
Restored page from Google Cache, uploaded by John Pye |
No edit summary |
||
| Line 1: | Line 1: | ||
The '''WHILE''' statement in ASCEND can be used to perform conditional looping actions within [[METHOD|METHODs]]. An example of the usage is | The '''WHILE''' statement in ASCEND can be used to perform conditional looping actions within [[METHOD|METHODs]]. An example of the usage is | ||
<source lang="a4c">WHILE i | <source lang="a4c"> | ||
x[i] | WHILE i > 5 DO | ||
x[i] := i; | |||
i := i - 1; | i := i - 1; | ||
END WHILE;</source> | END WHILE; | ||
</source> | |||
A test file using this syntax is {{src|models/test/while.a4c}}. | A test file using this syntax is {{src|models/test/while.a4c}}. | ||
== See also == | == See also == | ||
| Line 13: | Line 14: | ||
* [[FOR]] | * [[FOR]] | ||
[[Category:Documentation]] | |||
[[Category:Syntax]] | [[Category:Syntax]] | ||
Latest revision as of 02:32, 17 November 2013
The WHILE statement in ASCEND can be used to perform conditional looping actions within METHODs. An example of the usage is
WHILE i > 5 DO x[i] := i; i := i - 1; END WHILE;
A test file using this syntax is models/test/while.a4c.