Microsoft KB Archive/57376

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Knowledge Base


Article ID: 57376

Article Last Modified on 11/21/2006

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
                


Additional query words: MQuickB

Keywords: kbbug kbfix KB57376