09-08-2003, 04:31 AM
blah.bi:
blah.bas (main module):
blah2.bas (secondary module):
You could put a DIM SHARED in blah2.bas if you really wanted to, but it wouldn't do anything... just like the PRINT statement in blah2.bas. Module-level (outside of any SUB/FUNCTION) executable statements (like PRINT or DIM, not like DEFINT or COMMON) are ignored unless they're in the main module.
Code:
COMMON SHARED myArray() AS DOUBLE
...
blah.bas (main module):
Code:
'$INCLUDE:'blah.bi'
DIM SHARED myArray(234 TO 3453, 43 TO 456) AS DOUBLE
...
blah2.bas (secondary module):
Code:
'$INCLUDE:'blah.bi'
' No need for a DIM SHARED
PRINT "asdf" ' this line of source code will never be executed
... (SUBs, FUNCTIONs)
You could put a DIM SHARED in blah2.bas if you really wanted to, but it wouldn't do anything... just like the PRINT statement in blah2.bas. Module-level (outside of any SUB/FUNCTION) executable statements (like PRINT or DIM, not like DEFINT or COMMON) are ignored unless they're in the main module.