SUMMARY
TYPE definitions must all be contained in the module level code, and
are not allowed within SUB...END SUB or FUNCTION...END FUNCTION
blocks.
However, the QB.EXE environment of QuickBasic Versions 4.00, 4.00b,
and 4.50 can give confusing error messages if a TYPE definition is
entered into a SUBprogram or FUNCTION, making it seem as if TYPE
definitions are allowed in SUBprograms and FUNCTIONS.
This problem occurs only when using QB.EXE. If you compile your
program with BC.EXE and a TYPE definition exists within a SUBprogram
or FUNCTION, the following appropriate (and unconfusing) error message
displays:
"TYPE statement improperly nested
Skipping forward to END TYPE statement"
Within the QBX.EXE environment supplied with Microsoft Basic PDS
Version 7.00, the following correct error message is generated when
you attempt to put a TYPE declaration in a SUBprogram:
"Illegal in SUB, FUNCTION, and DEF FN"