This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
4rpl:commands:exists [2021/01/13 22:35] – created virgilw | 4rpl:commands:exists [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ~~NOTOC~~ | + | < |
- | < | + | |
- | === Syntax | + | ====== |
- | -?VAR | + | |
- | === Description | + | ===== Syntax ===== |
- | Checks to see if VAR exists (has been assigned). If so, 1 (true) is pushed to the stack else 0 (false). | + | |
- | === Examples === | + | -?VARNAME |
- | <code 4rpl>if (-?triggered !) | + | |
- | true -> | + | ===== Description ===== |
- | endif | + | |
+ | Checks to see if a variable with name **VARNAME **exists (has been assigned). If so, 1 (true) is pushed to the stack else 0 (false). | ||
+ | |||
+ | ===== Examples | ||
+ | |||
+ | <code 4rpl> | ||
+ | if (-?TheAnswer) # checks if the variable exists | ||
+ | " | ||
+ | else | ||
+ | "We do not have the answer" | ||
+ | endif | ||
</ | </ | ||
+ | |||
+ | ~~NOTOC~~ | ||
+ |