do
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | do [2006/07/28 04:10] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | #$EPIC: do.txt,v 1.2 2006/07/26 19:47:17 sthalik Exp $ | ||
| + | ======Synopsis: | ||
| + | __do__ < | ||
| + | __do__ { < | ||
| + | |||
| + | ======Description: | ||
| + | __DO__ has two uses. In its first use it is a synonym for [[EVAL]], | ||
| + | but it's a bad idea to use [[EVAL]] either. | ||
| + | |||
| + | Its second use is a post-test loop. You are obliged to put your commands | ||
| + | in curly braces and after the closing curly brace a [[WHILE]] expression. | ||
| + | __DO__ .. [[WHILE]] loops always execute at least once. You must be careful | ||
| + | to put the [[WHILE]] expression on the same line as the closing brace. | ||
| + | it is on the next line, EPIC will think it is a separate command. | ||
| + | |||
| + | ======See Also:====== | ||
| + | To force expansion of some variable $foo: | ||
| + | /do echo the variable $$foo expands to $foo | ||
| + | |||
| + | To run the same command in indefinite number of times, but at least once: | ||
| + | assign blah 2 | ||
| + | do { | ||
| + | echo $blah is lower than 3 | ||
| + | } while ( blah = rand(5) < 3 ) | ||
do.txt · Last modified: 2006/07/28 04:10 by 127.0.0.1
