Reply To: Question about CMAC Function GET_HIGHLIGHT

Product Compare Forums Multi-Edit Support Question about CMAC Function GET_HIGHLIGHT Reply To: Question about CMAC Function GET_HIGHLIGHT

#6900
deleyd
Participant

Re: Global Variables set to zero or NULL string:
Yes they disappear. You can see a list of all current global variables by going to VIEW -> SYSTEM. There you can see all the global string variables and all the global integer variables. If you set a global integer variable to zero (0) it will disappear from this list and no longer exist, and if you set a global string variable to NULL "" it will disappear from this list and no longer exist. This can be confusing, hence I added it to my Caveats.

However, if you access a global string variable that doesn’t exist,
[code:1rh2gno5]str s = Global_Str("MyGlobal");[/code:1rh2gno5]s will be set to a null string "".

And if you access a global integer variable that doesn’t exist,
[code:1rh2gno5]int i = Global_Int("MyGint");[/code:1rh2gno5] i will be set to zero (0).

This also works if you use global aliases:
[code:1rh2gno5]global{
int MyGint;
str MyGlobal;
}
...
int i = MyGint;
str s = MyGlobal;
[/code:1rh2gno5]
i will be set to zero (0)
s will be set to a null string ""

When you set a global integer variable to a value other than zero it will suddenly exist again and have that value. And if you set a global string variable to something not a NULL string it will suddenly exist again and hold that string.