11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Examples<br />

In the following example, the program segment searches the string STR for the<br />

number of occurrences of substring I, and returns the answer in the variable IC. After<br />

execution, IC contains 2}3}1.<br />

STR = "JAWSII":@VM:"ROCKYIII":@VM:"STARTREKIV"<br />

IC = COUNTS(STR,"I")<br />

In the next example, the same program segment compiled under BASICTYPE P or<br />

M searches the string STR for the number of occurrences of the substring II and<br />

assigns the values to the variable IC. After execution, IC contains 1}2}0.<br />

$BASICTYPE "P"<br />

STR = "JAWSII":@VM:"ROCKYIII":@VM:"STARTREKIV"<br />

IC = COUNTS(STR,"II")<br />

If the preceding code is compiled in BASICTYPE U or R, COUNTS returns “1}1}0”<br />

in the variable IC.<br />

COUNT 1-174

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

Saved successfully!

Ooh no, something went wrong!