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.

COUNTS<br />

Syntax<br />

COUNTS(expr,str.expr)<br />

Description<br />

The <strong>UniBasic</strong> COUNTS function returns the number of times a substring appears<br />

within each element of an array. The elements in the array you want to search, expr,<br />

must be longer than the substring str.expr. After str.expr is found, the system searches<br />

the array again with the new starting point after the entire first occurrence of str.expr.<br />

If str.expr is not found, COUNTS returns 0. COUNTS supports multibyte languages.<br />

Note: In BASICTYPEs P and M, after UniData finds str.expr, it searches the string<br />

again with the new starting point after the first character of the first occurrence of<br />

str.expr. UniData can find overlapping character strings.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

1-173 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

expr Specifies the array to search. The elements of this array must be longer than<br />

str.expr.<br />

str.expr Specifies the target string to search for and count occurrences of in elements<br />

of expr.<br />

COUNTS Parameters

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

Saved successfully!

Ooh no, something went wrong!