If_Defined - Crestron SIMPL+ Reference Manual

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

Advertisement

Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®
#IF_DEFINED ... #ENDIF
Name:
#IF_DEFINED ... #ENDIF
Syntax:
#IF_DEFINED <constant_name>
<code>
#ENDIF
Description:
Results in compilation of the <code> only if <constant_name> has previously been
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
OUT$ = ITOA(I);
}
The value of the loop is printed only if the DEBUG constant is defined. In order to
prevent compilation of the code, delete the line that defines the constant or comment
it out.
Version:
SIMPL+ Version 2.00
Software
®
SIMPL+
41

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