EasyManua.ls Logo

Crestron SIMPL+ - Find Function

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Software Crestron SIMPL+
®
220 z SIMPL+
®
Language Reference Guide - DOC. 5797G
Find
Name:
Find
Syntax:
INTEGER Find(STRING MATCH_STRING, STRING SOURCE_STRING
[,INTEGER START_POSITION]);
Description:
Finds the position in SOURCE_STRING where MATCH_STRING first occurs.
Parameters:
MATCH_STRING is a STRING containing the data to be searched.
SOURCE_STRING is a STRING containing the data to be searched.
START_POSITION is an INTEGER which tells FIND at what character in the string
to start the search, and is 1 based. If not specified, it defaults to 1.
Return Value:
The index of where MATCH_STRING first occurs (going left to right) in
SOURCE_STRING. If a match can not be found, or POSITION exceeds the length
of the SOURCE_STRING then 0 is returned. The index is 1 based.
Example:
STRING_INPUT IN$[100];
INTEGER START_LOC;
CHANGE IN$
{
START_LOC = FIND(“XYZ”, IN$);
PRINT(“XYZ was found starting at position %d in %s\n”,
START_LOC, IN$);
}
If IN$ was set equal to “Hello, World!” then START_LOC would be 0 since “XYZ”
can not be found. If IN$ was equal to “CPE1704XYZXYZ”, then START_LOC
would be equal to 8.
Version:
SIMPL+ Version 1.00

Table of Contents