If two subs are passing a variable and value back and forth, isn't it good to make note of that in something global like a BI file? It helps put things out in the open for users unfamiliar with the code to see and be aware of.
Why? If it’s for internal use only, the user doesn’t need to be aware of it, or interact with it at all.
A lot of times, you can code functions/subs so you normally wouldn’t need a *.BI file at all. The SaveState and RestoreState functions I wrote are a perfect example. When the first call is made to SaveState, it initializes a memblock to record up to 255 states to be saved. RestoreState works with that shared memblock to restore those states when called. Without someone using _OPTION EXPLICIT, they can be added to a single *.BM library and added into an user’s code.
What’s the advantage of requiring the user to have to add a COMMON SHARED, DIM SHARED, or DIM statement at the top of their code, just to avoid the OPTION _EXPLICIT error for a variable that’s only used internally within a library?
SUB foo
SHARED whatever <—— isn’t this, in fact, an explicit declaration of that variable?
If it’s not, then why is this valid:
SUB foo
STATIC whatever
Why’s the word STATIC count as a valid declaration, but SHARED not?
Since people are using OPTION _EXPLICIT, SHARED is now a worthless command for SUB and FUNCTION. May as well just DIM SHARED everything and force all libraries to come in two parts, rather than try to code and keep it simple so the end user only needs one *.BM file.