Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Crestron SIMPL+
®
Software 
Language Reference Guide - DOC. 5797G
 SIMPL+
®
 
z 221
Gather
Name:
Gather
Syntax:
STRING Gather(STRING DELIMITER, STRING SOURCESTRING);
Description:
Concatenates the data from SOURCESTRING and issues it on the return string when 
the specified delimiter has been reached. Note that when GATHER is executed, if 
SOURCESTRING does not include the DELIMITER, then the equivalent of a 
PROCESSLOGIC is performed. When the system returns to the GATHER, it will 
once again check for the proper delimiter. In effect, section of code (a CHANGE 
statement, for example) is held up at the GATHER until the proper data is received.
Parameters:
The gather function searches the SOURCESTRING for the DELIMITER string. 
Return Value:
The concatenated string which includes the delimiter specified. Example:
BUFFER_INPUT COM$[100];
DIGITAL_INPUT trig;
STRING IN$[100];
 
PUSH trig
{
IN$ = GATHER(“\n”, COM$);
PRINT(“The value of IN$ is %s\n”, IN$);
}
In this example, the event is started when TRIG goes high. When data comes into 
COM$, the GATHER statement is evaluated. The PRINT statement is never reached 
until the delimiter \n (CRLF) is found. When the delimiter is found, then the string 
will be printed. Note that the GATHERed string will have the \n on it.
NOTE: It makes sense only to use GATHER with STRING_INPUT or 
BUFFER_INPUT types.