Declaring Local and Global in a function

BlitzMax Forums/BlitzMax Programming/Declaring Local and Global in 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.

grey:
Global in a function means if you set X to some value, the next time you enter the function, X will still have that value you set.

It should be accessable to that function inside the function. But it's not, for whatever reason, either because of a bug or because functions in functions aren't fully supported.

Enay:
"Hmm, I didn't realise you could declare globals inside a function. That's quite unusuaul."

They're not accessable from outside the function if you were wondering that. They're just like static vars in C. I'm not sure why Mark chose to use the term Global. That doesn't really indicate the nature of them not being freed when the function exits. And if they're not accessable within functions in a function then function globals are even less like regular globals.