11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

COL2<br />

Syntax<br />

COL2( )<br />

Description<br />

The <strong>UniBasic</strong> COL2 function returns the column position following a substring<br />

found by the FIELD function. The COL2 function has no arguments. If you do not<br />

execute the FIELD before executing COL2, the function returns a zero. COL2<br />

supports multibyte languages.<br />

The FIELD function examines a string for a particular delimiter and returns the<br />

substring marked by the specified occurrence of that delimiter. While the FIELD<br />

function returns the substring itself, the COL2 function returns the position immediately<br />

after the substring within the string sent to the FIELD function.<br />

Example<br />

In the following example, the FIELD function searches the string STRING for the<br />

third occurrence of the delimiter “,”. FIELD assigns the substring “10” to the variable<br />

SSTR. The COL1 function assigns column 9, the column position of the character<br />

after “10”, to the variable SPOS2.<br />

STRING = "11,20,10,15,20,15"<br />

SSTR = FIELD(STRING,",",3)<br />

SPOS2 = COL2()<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

COL1, FIELD, INDEX<br />

COL2 1-158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!