User Tools

Site Tools


crpl:docs:exists

<- CRPL reference <- Vars and Functions

-?VARNAME

Syntax

-?!

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.txt · Last modified: 2022/06/28 15:53 by Karsten75