I noticed your comment of Global Constants and thought I would clarify what GLOBAL means in ScriptBasic.
By default, all variables are global to the module. MAIN:: is the primary module in SB.
Okay, I'm glad you did.
I was unclear about
scope. Generally speaking, in Basic, variables and constants are global, but, after reading the docs I was unclear. The docs are a bit shy on illustrations and examples. I wanted to expedite the process and not take chances of a constant not being recognized.
Unless you declare a variable LOCAL in a SUB or FUNCTION, it is a global variable.
Ummm..., does that mean that vars declared within a SUB are global in scope, if not declared as LOCAL ?
My assumption (and hope) would be that they would be LOCAL only to that SUB and be destroyed on exiting the SUB, regardless of being declared as LOCAL.
i.e.:
SUB MySub
myint = 100
mystr$ = "hello"
' do stuff
END SUB
...MySub.myint no longer exists.
...MySub.mystr$ no longer exists.
would this be true or not ?
The matter of
scope has been a topic of much discussion from the eariest programming languages and seldom agreed upon from one language to the next.