Global inside a Function

BlitzMax Forums/BlitzMax Beginners Area/Global inside a Function

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.

But why would you use a Global? Wouldn't Local be more appropriate? Would Local have the same result?

I can see what the example is doing, but I cant figure out why? When the function is called for the second time, why is the Global not reinitialised and set back to 1?

In my head, it the example should print 1, 2, 1, 2

So many questions...