FIX: Passing PEEKL to a SUBprogram Returns "Type Mismatch" (57376)






This article was previously published under Q57376

SYMPTOMS

Using the PEEKL function as an argument for a SUBprogram that accepts a LONG data type produces a "Type mismatch" error when run from within the QuickBasic Interpreter.

Compiling the program and running the application does not produce the error.

To work around this problem, assign the result of the PEEKL function to a temporary variable and then pass this through the argument list of your SUBprogram.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic version 1.00 for the Macintosh . This problem is corrected in QuickBasic version 1.00b.

MORE INFORMATION

Code Example

The following code produces the error in the interpreter:
   CALL ArgPass(PEEKL(10000))     ' "TYPE MISMATCH" error here
   END
   SUB ArgPass(longArg&) STATIC
      PRINT longArg&
   END SUB
				
The following is a workaround:
   temp& = PEEKL(10000)
   CALL ArgPass(temp&)
   END
   SUB ArgPass(longArg&) STATIC
      PRINT longArg&
   END SUB
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: kbbug KB57376