while
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | while [2006/08/29 16:08] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ======Synopsis: | ||
| + | __while__ (< | ||
| + | __while__ (< | ||
| + | |||
| + | ======Description: | ||
| + | The __WHILE__ loop is a sort of hybrid between the [[FOR]] loop and the [[IF]] | ||
| + | control statement. | ||
| + | but the loop iterates (performs the action) only if a specific | ||
| + | condition is met, as with [[IF]]. | ||
| + | |||
| + | The " | ||
| + | allowed in an [[IF]] statement. | ||
| + | |||
| + | ======Examples: | ||
| + | To display a warning message 3 times: | ||
| + | @ xx = 3 | ||
| + | while ( xx > 0 ) { | ||
| + | echo WARNING! | ||
| + | @ xx-- | ||
| + | } | ||
| + | |||
| + | A infinite loop that behaves like the Unix ' | ||
| + | while ( 1 ) echo yes | ||
| + | |||
| + | ======Aliases: | ||
| + | [[UNTIL]] is the exact opposite of __WHILE__. | ||
| + | applying the negation operator (!) to the entire __WHILE__ condition. | ||
| + | |||
| + | ======Other Notes: | ||
| + | __WHILE__ has all of the capabilities of [[FOR]], only in a different syntax. | ||
| + | The distinction between the two is not great enough to warrant a | ||
| + | recommendation of one over the other. | ||
| + | more concise than __WHILE__; however, this is not always the case. | ||
| + | |||
while.txt · Last modified: 2006/08/29 16:08 by 127.0.0.1
