User Tools

Site Tools


prpl:existsglobal

<- PRPL reference <- Vars and Functions

-?*VARNAME

ArgumentsResultNotation
none True/False [ - b1 ]

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

# In one script:
42 ->*myGlobalVariable
# In any script on the same map after that point:
-?*myGlobalVariable if
    "myGlobalVariable exists."
else
    "myGlobalVariable does not exist."
endif
trace
# Puts "myGlobalVariable exists." in the debug window.
	stack.Push(new Data(GameSpace.instance.globalHeap.ContainsKey(command.data.GetString()) ? 1 : 0)); 
 
prpl/existsglobal.txt · Last modified: 2017/10/24 18:17 by GameGibu