FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


#define and #undef

Syntax:

#define < cpp Macro >

#undef < cpp Macro >

Function:

fpt interprets cpp macros embedded in the Fortran code. The commands #define and #undef may be written in fsp files and within the Fortran code to define and undefine macros. In fsp files they are position sensitive and apply to the files which follow them. In the Fortran code they are position sensitive and apply within the files in which they are written and to all files included by #include directives. Note that they do not apply to include files referenced by Fortran INCLUDE statements.

The commands #define and #undef written in fsp files may, but are not required to be introduced by % characters. In the Fortran code they must be written with the # character in column 1. White space characters may be written between the # character and the following keyword. The use of these, and of all other cpp directives conforms to the stype specified to gnu cpp by the -traditional switch. Please see the description of cpp handling by fpt for a detailed description.

The macros defined in fsp files and in the Fortran code are displayed by the command show cpp macros.

Note that the command DEFINE written without a leading # character defines a logical symbol used in file name handling and does not define a cpp macro.

Where to use this command:

Operating system command line

Yes


Configuration file, config.fsp

Yes


Specification (FSP) files, *.fsp

Yes


Interactively, to FPT> prompt:

No


Interactive command files

No


Embedded in the Fortran code

Yes


Default:

Two macros are pre-defined:

__FILE__ The current file name, without the directory name
__LINE__ The line number within the current file


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.