DOCERR: Using the /4ccstring Switch for Conditional Compilation

Last reviewed: July 18, 1995
Article ID: Q49451
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, 5.1

SUMMARY

The /4ccstring compiler option switch permits conditional compilation in a source file. According to page 355 of the Microsoft FORTRAN "Reference" manual for versions 5.0 and 5.1,

   The /4cc option permits conditional compilation of a source file.
   The string is a set of alphabetic characters controlling which
   lines in the source file are to be compiled.

A similar statement appears on page 93 of the Microsoft FORTRAN "User's Guide" for versions 4.0 and 4.1.

MORE INFORMATION

The following code example demonstrates conditional compilation.

Sample Code

C Compile options needed: See below

      PROGRAM TEST
L INTEGER*4 NUM S INTEGER*2 NUM R REAL*4 NUMBER
      END

If you compile this code with the /4ccL option switch, the compiler reserves 4 bytes for NUM. If you specify the /4ccS option switch, the compiler reserves 2 bytes for NUM. If you omit the /4cc option switch, the L, S, and R lines are considered comment lines. If you specify the /4ccLS option switch, a multiply-defined symbol error occurs because NUM is defined twice. Compiling with the /4ccLR or /4ccSR option switch defines NUM with the desired size and defines NUMBER as a REAL*4.


Additional reference words: 4.00 4.01 4.10 5.00 5.10
KBCategory: kbother kbdocerr
KBSubcategory: FLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.