Microsoft KB Archive/51077
Article ID: 51077
Article Last Modified on 11/21/2006
This article was previously published under Q51077
When using CALL ABSOLUTE in a Microsoft Basic program, the error message "Argument Count Mismatch" occurs if parameters are passed to the CALLed routine and the DECLARE for CALL ABSOLUTE in QB.BI is not changed.
This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS, and to Microsoft Basic PDS Version 7.00 for MS-DOS.
The following lines appear in the include file QB.BI shipped with QuickBasic Versions 4.00, 4.00b, and 4.50 and Microsoft Basic Compiler Versions 6.00 and 6.00b, and in QBX.BI shipped with Microsoft Basic PDS Version 7.00:
'Call a routine at an absolute address. 'NOTE: If the routine called takes parameters, then they will have to ' be added to this declare statement before the parameter given. DECLARE SUB ABSOLUTE (address AS INTEGER)
This DECLARE statement must be changed if any parameters are passed to the CALLed routine. For example, if the CALLed routine was passed two parameters as follows
CALL ABSOLUTE(FirstNumber!, SecondNumber%, VARPTR(AsmProg(1)))
then the DECLARE statement in QB.BI or QBX.BI should be changed to the following:
DECLARE SUB ABSOLUTE(A AS SINGLE, B AS INTEGER, address AS INTEGER)
Additional query words: QuickBas BasicCom