$OPTION Metacommand Is Similar to $LONG and $OPTION (33049)






This article was previously published under Q33049

SUMMARY

The $OPTION metacommand was introduced in Microsoft BASIC Compiler Version 1.00 for the Apple Macintosh. For upward compatibility, $OPTION is also supported in QuickBASIC Version 1.00 for the Apple Macintosh. The $OPTION metacommand instructs the compiler in the following ways:
   Metacommand Option       Description
   ------------------       -----------

   $OPTION A                Use long addressing mode

   $OPTION +A               Use long addressing mode

   $OPTION -A               Do not use long addressing mode

   $OPTION C                Check array boundaries, and overflow

   $OPTION +C               Check array boundaries, and overflow

   $OPTION -C               Do not check array boundaries, and overflow
				
The compiler in QuickBASIC for the Apple Macintosh also provides the $LONG metacommand to turn on and off long addressing and the $CHECK metacommand to turn on and off checking of array boundaries. Microsoft recommends using the new $LONG and $CHECK metacommands, which are easier to remember than $OPTION.

One QuickBASIC customer reported that he had selected "Use Long Addressing" in the Options dialog box but still received "Must use long addressing mode" error messages at compile time. The customer solved the problem by adding the metacommand REM $LONG directly into the source code.

MORE INFORMATION

QuickBASIC allows you to set various options that affect compilation. Most options are set for the entire source file by checking the appropriate boxes in the dialog box for the Options command on the Run menu. However, the $OPTION, $LONG, and $CHECK metacommands let you turn on or off the compiler option in specified parts of the source file.

The following two programs use equivalent metacommands to turn on checking of array boundaries and overflow conditions:

  1.    REM $OPTION C
       DIM ARR% (2, 2)
       ARR% (0, 0) = 1
       END
    						
  2.    REM $CHECK ON
       DIM ARR% (2, 2)
       ARR% (0, 0) = 1
       END
    						

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB33049