Noob Global Scope

BlitzMax Forums/BlitzMax Beginners Area/Noob Global Scope

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.

Hi clever people

Ive been looking though the code archives and tutorials and Ive noticed something.

Sometimes variables at Global scope are declared as "Local"

Now thinking about this logicaly I could assume that Globals declared Variable are "Static" across all the instances of the program that are running, however Im nearly sure that BMax doesnt work like that.

Or I could assume that in this situation
#Label
Global x:int =0
X:+1
Print x
Goto Label
The decleration of X is static, and so the output would be 1,2,3,4,5,6 etc whereas
#Label
Local x:int =0
X:+1
Print x
Goto Label
X would be reset to 0, so the output would be 1,1,1,1,1

Which they do ;) Edit: GLobal 1,2,3,4,5 Local 1,1,1,1,1,1
So Ive seen for myself that there is a differnce between Local at Global Scope, and Global at Global Scope. (A difference that Ive never seen before)

However, although Its useful, I dont really use this feature (Well I do in Functions and the like, but not at global scope Cos I didnt know it was there), so Im willing to Local or Global Global scope variable. But are there any other differences that Im unaware of? Like ,speed or Optimisation etc.