Conditional compilation of statements¶
!ifdef |
Compile statements only if a symbol has been defined |
!ifndef |
Compile statements only if a symbol has not been defined |
!else |
Optional clause in an !ifdef or !ifndef construct |
!endif |
Declare the end of an !ifdef or !ifndef construct |
SYNTAX
!ifdef |
The statements between an !ifdef and the corresponding !endif are included by the compiler only if the named symbol has been previously defined with a !define statement. The optional !else clause may be used to list statements which are to be included only if the first set of statements are excluded, and vice versa. |
!ifndef |
The above rules are simply reversed for !ifndef. The statements between an !ifndef and the corresponding !endif are included by the compiler only if the named symbol has not been previously defined with a !define statement. The optional !else clause may be used to list statements which are to be included only if the first set of statements are excluded, and vice versa. |
!else |
This optional clause in an !ifdef or !ifndef construct is used to list statements which are to be included only if the first set of statements are excluded, and vice versa. |
!endif |
Every !ifdef or !ifndef declaration must have a matching !endif to mark the end of the code it controls. |
NOTES
The statements following an !ifdef, !ifndef or !else declaration may contain other complete !ifdef and !ifndef constructs.
A symbol may also be defined by using the -D option when a program is compiled with the source code compiler scc.
Certain manifest constants are already predefined in Sculptor. These are mostly located in standard include files in the directory $SCULPTOR/include. See Standard include files.
EXAMPLE
!ifdef SAGE
DisplayMessage(Msg)
!else
PrintMessage(Msg)
!endif
RELATED TOPICS |