Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

FIELD

Description

This function returns a multi-character delimited field from within a string. It takes the general form:

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

where:

  • string specifies the string, from which the field(s) is 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, assumes one. 

Note:  

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. 

An example of use is as:

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

to display:

CCCCC
AAAA:BB


See also: GROUP

Go back to jBASE BASIC.

Was this article helpful?