FIELD


The FIELD function will return a multi-character delimited field from within a string.

 

COMMAND SYNTAX

FIELD(string, delimiter, occurrence{, extractCount})

 

SYNTAX ELEMENTS

string specifies the string from which the field(s) are to be extracted.
delimiter specifies the character or characters that delimit the fields within the dynamic array.
occurrence should evaluate to an integer of value 1 or higher. It specifies the delimiter used as the starting point for the extraction.
extractCount is an integer that specifies the number of fields to extract. If omitted, 1 is assumed.

 

NOTES

If the emulation option jbase_field is set then the field delimiter may consist of more than a single character, allowing fields to be delimited by complex codes.

If extractCount is greater than 1 then only the first character of delimiter is used, regardless of the setting of jbase_field.

See also GROUP.

 

EXAMPLES

Fields = "AAAA:BBJIMBB:CCCCC"
CRT FIELD(Fields, ":", 3)
CRT FIELD(Fields, "JIM", 1)

displays:
CCCCC
AAAA:BB


jBC