Microsoft KB Archive/57376: Difference between revisions
(importing KB archive) |
m (Text replacement - "&" to "&") |
||
Line 51: | Line 51: | ||
<pre class="codesample"> CALL ArgPass(PEEKL(10000)) ' "TYPE MISMATCH" error here | <pre class="codesample"> CALL ArgPass(PEEKL(10000)) ' "TYPE MISMATCH" error here | ||
END | END | ||
SUB ArgPass(longArg& | SUB ArgPass(longArg&) STATIC | ||
PRINT longArg& | PRINT longArg& | ||
END SUB | END SUB | ||
</pre> | </pre> | ||
The following is a workaround: | The following is a workaround: | ||
<pre class="codesample"> temp& | <pre class="codesample"> temp& = PEEKL(10000) | ||
CALL ArgPass(temp& | CALL ArgPass(temp&) | ||
END | END | ||
SUB ArgPass(longArg& | SUB ArgPass(longArg&) STATIC | ||
PRINT longArg& | PRINT longArg& | ||
END SUB | END SUB | ||
</pre> | </pre> |
Latest revision as of 14:14, 21 July 2020
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