Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/34276

From BetaArchive Wiki
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

SYMPTOMS

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.


MORE INFORMATION

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:

   '$CHECK ON
   x=3
   CALL test(x)
   SUB test(x) STATIC
   PRINT x
   END SUB
                

Program 2:

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


Additional query words: MQuickB

Keywords: kbbug KB34276