This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| prpl:existsglobal [2016/12/02 23:33] – external edit 127.0.0.1 | prpl:existsglobal [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <- [[.: | + | <- [[.: |
| - | ===== | + | ===== |
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | | | | [ - ] | | + | | none | True/ |
| === Description === | === Description === | ||
| + | |||
| + | Checks to see if global variable VARNAME exists (has been assigned). If so, 1 is pushed to the stack else 0. Global variables can be accessed by any script on the map. | ||
| === Examples === | === Examples === | ||
| + | <code prpl> | ||
| + | # In one script: | ||
| + | 42 -> | ||
| + | # In any script on the same map after that point: | ||
| + | -? | ||
| + | " | ||
| + | else | ||
| + | " | ||
| + | endif | ||
| + | trace | ||
| + | # Puts " | ||
| + | </ | ||
| < | < | ||
| </ | </ | ||