Description

Returns a substring from a string expression. The substring is specified by a delimiter character and which instance of the delimiter character is to be calculated.

Syntax

substring = Field (string, delimiter, occurrence[, fieldcount])

Parameters

The Field function has the following parameters.

ParameterDescription
StringThe source string for the Field operation.
DelimiterThe value of delimiter determines what in the string is considered a field. It does this by treating all data before the delimiter (but after any previous instance of the delimiter) as the field. If the delimiter does not exist in the string, one of two possible values will be returned:

· If the first occurrence of delimiter is specified, the entire string is returned.

· If another occurrence is specified, and either the delimiter or the occurrence does not exist, a null value is returned.

OccurrenceSpecifies which "field" is to be returned. For example, if the value of occurrence is 3, then the element occurring immediately before the third occurrence of the delimiter will be returned. If the delimiter in occurrence evaluates to less than 1 (one), 1 (one) is assumed.
FieldcountDefines the number of successive fields that are to be returned with the substring. The delimiter(s) will be included as part of the returned value. A 1 (one) is assumed if field is null or less than 1 (one).

See also

[ ] (Brackets operator)Col1()Col2()ExtractFieldStore()

Example

* Parse a repository id
RepositoryID = "EXAMPLES*OIEVENTEXE*CLICK*INV_ENTRY.BTN_SEARCH"
appid = Field( RepositoryID, "*", 1 )
type = Field( RepositoryID, "*", 2 )
class = Field( RepositoryID, "*", 3 )
name = Field( RepositoryID, "*", 4 )
  • No labels