Microsoft KB Archive/34276

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 14:14, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base

BUG: System Error/Hang w/ $CHECK ON Metacommand & SUB Program

Article ID: 34276

Article Last Modified on 11/21/2006

This article was previously published under Q34276


If you use the in-line metacommand $CHECK ON (or $OPTION +C) and are calling a SUBprogram in a Basic source file, the compiled program can hang or give a system error (such as ID=2 or 3) at run time. If you pass no parameters to the subprogram, the compiled program may work on a Macintosh II but will fail on a Macintosh SE.

Microsoft has confirmed this to be a bug in the Microsoft QuickBasic Compiler Version 1.00 for the Macintosh . (This problem also occurs with $OPTION +C in the Microsoft Basic Compiler Version 1.00). We are researching this problem and will post new information as it becomes available.

The following are two workaround solutions:

  1. Compile with the Process Runtime Events option. $CHECK ON then works.
  2. Remove the $CHECK ON in-line metacommand, and use the equivalent Check Arrays & Overflow compiler option instead.
  3. This problem does not occur in the interpreter in QuickBasic or in Versions 3.00 and earlier of the Microsoft Basic interpreter.


Note that the Microsoft Basic Compiler Version 1.00 uses $OPTION +C instead of $CHECK ON. QuickBasic Version 1.00 supports both $CHECK ON and $OPTION +C, which perform the same function, but $CHECK ON is a better mnemonic.

The following compiled programs hang at run time when compiled without the Process Runtime Events option:

Program 1:

   CALL test(x)
   SUB test(x) STATIC
   PRINT x

Program 2:

   '$OPTION +C
   CALL test(x)
   SUB test(x) STATIC
   PRINT x

Additional query words: MQuickB

Keywords: kbbug KB34276