col1() Function

The col1() function returns the numeric column position of the character immediately preceding the substring retrieved in the most recently executed field() function.

Syntax

col1()

Description

The parentheses following the function are required, and contain no arguments.

col1() allows nonsystem delimited strings to be handled like dynamic arrays.

If the search value does not exist in the string being searched by the field() function, 0 is returned for the col1() function.

Example(s)

This example removes red from colors.

colors = "blue*green*red*yellow*orange"

name = field(colors,"*",3)

start.pos = col1() ;* start.pos is 11

end.pos = col2() ;* end.pos is 15

colors = colors[1,start.pos]:colors[end.pos+1,100]

See Also

field() Function, BASIC Functions, occurs() Function, Statements and Functions