EasyManua.ls Logo

Crestron SIMPL+ - #IF_NOT_DEFINED... #ENDIF Directive

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Software Crestron SIMPL+
®
44 z SIMPL+
®
Language Reference Guide - DOC. 5797G
#IF_NOT_DEFINED … #ENDIF
Name:
#IF_NOT_DEFINED … #ENDIF
Syntax:
#IF_NOT_DEFINED <constant_name>
<code>
#ENDIF
Description:
Results in compilation of the <code> only if <constant_name> has not been
previously defined. This construct is generally useful for putting in code for
debugging purposes, giving the ability to easily turn the debugging on and off during
compilation.
Example:
#DEFINE_CONSTANT DEBUG 1
DIGITAL_OUTPUT OUT$;
INTEGER I;
FOR(I=0 to 20)
{
#IF_DEFINED DEBUG
PRINT(“Loop index I = %d\n”, I);
#ENDIF
#IF_NOT_DEFINED_DEBUG
OUT$ = ITOA(I);
#ENDIF
}
The value of the loop is only printed if the DEBUG constant is defined. The output
OUT$ is only generated if the debug constant is not defined (if debug mode is not
turned on). In order to generate “release” code, the debug constant can be deleted or
commented out.
Version:
SIMPL+ Version 2.00

Table of Contents

Other manuals for Crestron SIMPL+

Related product manuals