2. Writing Scripts and Procedures : How Procedure Handles Work (ProcHandle Objects) : Global Procedures Available in the Core Library : The _StringParseKeyword Procedure
 
Share this page                  
The _StringParseKeyword Procedure
The _StringParseKeyword procedure returns the value of the specified keyword in a specially formatted string. This string's format is:
keyword1=value1[;keyword2=value2]”
The equal sign separates a keyword from its value. The semicolon must be used to separate the end of a value from the next keyword. There is no space allowed before or after the equal sign. Everything between the semicolon (or the beginning of the string) and the equal sign is treated as part of the keyword. The last value does not have to end with the semicolon. If a value has trailing white space, it will be trimmed. Leading and embedded white space is retained.
The search for the keyword is not case sensitive. Trailing white space on keyword is trimmed before the search begins. If the keyword is found, its value is returned. If either the string or the keyword argument is empty, an empty string is returned.
Example syntax for the _StringParseKeyword procedure is:
varchar(2000) = _StringParseKeyword(string = varchar(2000),
           keyword = varchar(32);)
The following is an example of how to use the _StringParseKeyword procedure to find the value of a keyword:
str1 = 'Name=John Doe;
Address=101 California, USA';
value=_StringParseKeyword(string = str1,
                keyword = 'address');
This example returns the string “101 California, USA”.