User Tools

Site Tools


crpl:docs:exists

This is an old revision of the document!


~~DISCUSSION~~ <- CRPL reference <- Vars and Functions

-?VARNAME

ArgumentsResultNotation
0 or 1 depending on if VARNAME exists – i1

Description

Checks to see if VARNAME exists (has been assigned). If so, 1 is pushed to the stack else 0. Local variables persist across script invocations.

Examples

# check to see if variable "Spore" exists. 
# If not, fire a spore and set the variable so no 
# further spores will launch. 
-?Spore if 
	CurrentCoords RandUnitCoords 1 20 CreateSpore 
	"fired" ->Spore 
endif
crpl/docs/exists.1412190170.txt.gz · Last modified: 2025/02/14 14:56 (external edit)