Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
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