Home » Community » Newbie corner » Global variables in Upp
Re: Global variables in Upp [message #28691 is a reply to message #28688] |
Sun, 12 September 2010 09:52 |
|
Hi Jerson,
There is a nice helper for this kind of situation in U++. The macro GLOBAL_VAR (probably undocumented too ). It creates a function returning static variable, so in effect it can be used as global variable accessible wherever you declare the function and BLITZ-safe. The usage is simple, e.g.:GLOBAL_VAR(int,gvar);
gvar() = 5; //setting
int b = gvar(); //getting
The price is typing the extra two parenthesis, but as global variables are not used very often, it should be not a big trouble.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Thu May 09 09:31:50 CEST 2024
Total time taken to generate the page: 0.02635 seconds
|