PtrGlobalDefine

Marks a variable as being globally accessible.

Syntax:

PtrGlobalDefine(variable-name)

Parameters:

(s) variable-name specifies a variable name.

Returns:

(s) pointer a pointer string.

 

This function can only be called from the main script, not from a UDF.

If "variable-name" does not already exist, it will be created.

Example:


#DefineFunction CheckGlobalValue()
Ptr_Global_A=PtrGlobal(Global_A)
Ptr_Global_B=PtrGlobal(Global_B)
If *Ptr_Global_A != "Potatoes"
   Message("Error","Global_A is not the expected value")
EndIf
*Ptr_Global_B = 1234
#EndFunction
PtrGlobalDefine( Global_A)
PtrGlobalDefine( Global_B)
Global_A = "Potatoes"
retvalue=CheckGlobalValue()
If Global_B != 1234
   Message("Error","Global_B is not the expected value")
EndIf
See Also:

PtrGlobal, PtrPersistent