Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®
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.
NOTE: It makes sense only to use GATHER with STRING_INPUT or
BUFFER_INPUT types.
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.
Software
®
SIMPL+
221
Need help?
Do you have a question about the SIMPL+ and is the answer not in the manual?