U++ framework
Do not panic. Ask here before giving up.

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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Jerson,

There is a nice helper for this kind of situation in U++. The macro GLOBAL_VAR (probably undocumented too Smile ). 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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Limits check in Meter code
Next Topic: GLCtrl: does it support multisamplig feature?
Goto Forum:
  


Current Time: Thu Jun 04 04:31:55 GMT+2 2026

Total time taken to generate the page: 0.00683 seconds