This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
crpl:docs:if [2013/01/14 14:04] – created virgilw | crpl:docs:if [2014/10/01 15:02] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | TODO | + | ~~DISCUSSION~~ |
+ | <- [[crpl: | ||
+ | ===== if ===== | ||
+ | |||
+ | ^Arguments^Result^Notation^ | ||
+ | |Cond| |'' | ||
+ | |||
+ | |||
+ | === Description === | ||
+ | Evaluate the first element on the stack. | ||
+ | If True, then execute statements that follow, up to the endif statement. | ||
+ | If False, execution skips to the first statement following the endif statement. | ||
+ | Any nonzero value is consierered True, a value of zero is False. | ||
+ | === Examples === | ||
+ | < | ||
+ | # Creates a runner at the units current coordinates | ||
+ | # every three seconds, but only if there is digitalis underneath. | ||
+ | CurrentCoords GetDigitalis if | ||
+ | CurrentCoords 2 10 20 CreateRunner | ||
+ | 90 Delay | ||
+ | endif | ||
+ | </ |