If_Not_Defined - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software
®
44
SIMPL+
#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
Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIMPL+ and is the answer not in the manual?

Table of Contents

Save PDF