The value of the COL1() function is maintained on a per-program basis. If an external subroutine is called between extracting the data and use of the COL1() function, the positional data is not lost by any use of the FIELD() or LAST() function in the subroutine.
COL1() returns zero if
The last field extracted was at the start of the string
The delimiter to the last FIELD() function was a null string
The field number of the last FIELD() function was beyond the end of the string
S = "A*BB*CCC*DDDD*EEEEE"
X = FIELD(S, "*", 3, 2)
N = COL1()
This program fragment extracts the string "CCC*DDDD" to variable X. The COL1() function returns 5 and assigns this to N.