Use the KEYVAL() function to scan an input string for a key.
The KEYVAL() function has this syntax:
result = KEYVAL(string,key,[default])
The KEYVAL() function takes these arguments:
Contains one of the following:
If an error occurs, error text is returned.
If key is found, the next blank-delimited word is returned.
Otherwise, the value for default is returned.
Text string to be scanned.
Keyword value to scan for in the input string.
If matched, the value returned is the first non-blank character after key, and all subsequent characters until the next blank.
Value to be returned if key is not found. The default is null string.
The KEYVAL() function produces these return codes:
ARG n MISSING OR INVALID
Example
keyval('a hush was heard','hu','NOT FOUND') == 'was'
/* Next word */
keyval('a hush was heard',' hu ','NOT FOUND') == 'NOT FOUND'
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |