CALL BYVAL "Parameter Type Mismatch" After DECLARE AS ANY (45892)
This article was previously published under Q45892
SYMPTOMS
Using the CALL subprogramname (BYVAL variable) method of calling an
external (non-Basic) routine, where the parameter is specified AS ANY
in the DECLARE statement, correctly causes a "Parameter Type Mismatch"
at compile time.
To avoid this error, you must add BYVAL and specify the exact type
(instead of using AS ANY) in the DECLARE statement, and you must not
use BYVAL in the CALL statement. This information applies to Microsoft
QuickBasic Versions 4.00, 4.00b, and 4.50, to Microsoft Basic Compiler
Versions 6.00 and 6.00b, and to Microsoft Basic Professional
Development System (PDS) Version 7.00.
The "Parameter Type Mismatch" error fails to be flagged in the QuickBasic
Version 4.50 environment when the external routine is in a Quick Library.
QuickBasic Versions 4.00 and 4.00b correctly flag the error.
STATUS
Microsoft has confirmed this to be a bug in QuickBasic Version 4.50. We are
researching this problem and will post new information here in the
Microsoft Knowledge Base as it becomes available.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB45892 |
|