Previous Topic: IROUTE()Next Topic: LOADIMOD()


KEYVAL()

This function scans an input string for a key.

Syntax

result = KEYVAL(string,key,[default])

Parameters

result

Contains one of the following results:

If an error occurs, error text is returned.

If the key is found, the next blank-delimited word is returned.

Otherwise, the value for default is returned.

string

Text string to be scanned.

key

Keyword value to scan for in the input string.

If matched, the value that is 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.

Default: null string.

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'