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 ()
COL1/COL2 Functions (DataBasic) (m618703+col_f.htm)
Returns the numeric values of the column positions immediately preceding and following the substring specified by the FIELD function.
COL1()
COL2()
COL1() returns the numeric value of the column position immediately preceding the substring selected by the most recently executed FIELD function.
COL2() returns the numeric value of the column position immediately following the substring selected by the most recently executed FIELD function.
If a FIELD function has not been executed in a program before executing a COL1() or COL2() function, a warning message is displayed and COL1() or COL2() returns zero.
If the most recent FIELD function delimiter is null, then COL2() = COL1() + 1. If the specified delimiter cannot be found in the string, COL2() returns zero.
Q = FIELD("ABCBA","B",2) R = COL1() S = COL2()
Assigns the string value C to variable Q, the numeric value 2 to variable R and the numeric value 4 to variable S.
X = "K" A = FIELD("123K456K789",X,2) B = COL1() PRINT B C = COL2() PRINT C
Assigns the string value of 456 to variable A. Assigns the numeric values of 4 to variable B and 8 to variable C. Prints B and C.