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:
|
result |
Contains one of the following:
|
|
string |
Text string to be scanned. |
|
key |
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. |
|
default |
Value to be returned if key is not found. The default is null string. |
The KEYVAL() function produces these return codes:
|
101 - 103 |
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 © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |