Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
FIELD Function (DataBasic) (m618703+field_f.htm)
Returns a character-delimited field from within a string.
FIELD(string, delimiter, fieldNumber)
string An expression that evaluates to the string to be searched.
delimiter The character used as a field delimiter. If delimiter contains more than one character, only the first is used.
fieldNumber A positive integer specifying which field to return. The fields are numbered starting from 1. If the field number is less than 1, field 1 is returned.
If delimiter is a empty string, an empty string is returned.
If data case insensitive mode is selected (see Case Sensitivity), case is ignored when searching string for delimiter.
GROUP function, COL1/COL2 functions.
T = "12345.67891.98765" G = FIELD(T,".",1)
Returns the substring 12345 to variable G.
A=FIELD("XXX:YYY:ZZZ:555",":",3)
Assigns the value ZZZ to variable A.
X = "77$ABC$XX" Y = "$" Z = "ABC" IF FIELD(X,Y,2)=Z THEN STOP
Terminates the program because the FIELD function returns the value "ABC" which is equal to Z.