Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Crestron SIMPL+
®
Software 
Language Reference Guide - DOC. 5797G
 SIMPL+
®
 
z 41
#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