Why does global initializers need to be constant?

BlitzMax Forums/BlitzMax Programming/Why does global initializers need to be constant?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A Global from the main code means a variable that is automatically shared/accesible throughout any section of the code. A Global inside a Function means a variable that can only be accessed by that function, but the variable holds it's value between calls to that function. ie the value when the variable is initialised is 0 (unless otherwise stated), when the functin ends it's 5 - next time you call the function the variable holds the value 5 again.

I'd assume a global inside a type would be a variable whose value holds the same for all instances of that object - say you have two references to that object - if you change the global variable in one reference, it automatically becomes that value in the other object as well.