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.

CONVERT<br />

Syntax<br />

CONVERT(expr1, expr2, expr3)<br />

Description<br />

The <strong>UniBasic</strong> CONVERT function changes all occurrences of the substring expr1 in<br />

expr3 to the string expr2. The system compares each character of the replacement<br />

string expr2 and, if necessary, replaces each character of the target string expr1 on an<br />

individual basis. <strong>UniBasic</strong> does not compare and insert strings as a whole.<br />

CONVERT supports multibyte languages.<br />

CONVERT can delete characters from a string expression, but it does not insert<br />

additional characters. If the replacement substring expr2 contains more characters<br />

than are in the substring it replaces (expr1), the extra characters are ignored.<br />

Parameters<br />

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

Examples<br />

Parameter Description<br />

expr1 Specifies the target string to replace with expr2.<br />

expr2 Specifies the string with which to replace expr1.<br />

expr3 Specifies the string to search for expr1.<br />

CONVERT Parameters<br />

In the following example, the program segment changes OLDSTR to NEWSTR,<br />

which now contains “868,848,838,808”:<br />

OLDSTR = "767,747,737,707"<br />

NEWSTR = CONVERT("7","8",OLDSTR)<br />

CONVERT 1-168

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

Saved successfully!

Ooh no, something went wrong!