SUMMARY
For the following statement, the BC.EXE compiler correctly generates
the compile-time error message "Formal parameter specification
illegal," while the QuickBasic QB.EXE editor does not give any error
message:
DECLARE SUB prompt (prompt$)
The following is another example with the same symptoms, plus a
"Duplicate Definition" error from BC.EXE:
DECLARE FUNCTION age#
DECLARE SUB prompt (age$)
The above error messages result from the requirement in QuickBasic
versions 4.0, 4.0b, and 4.5, Microsoft Basic Compiler versions 6.0 and
6.0b, and Microsoft Basic Professional Development System (PDS)
versions 7.0 and 7.1 that procedure and variable names must be
different. Therefore, programs cannot contain functions or subprograms
whose names are the same as those of variables.
Note that the QB.EXE environment of QuickBasic versions 4.0, 4.0b,
and 4.5 and the QBX.EXE environment of Basic PDS 7.0 correctly gives
you a "Duplicate Definition" error on the following CALL or SUB
statement:
CALL PROMPT(PROMPT$)
Therefore, the lack of warning of "Duplicate Definition" for the
DECLARE statement is a minor issue.