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.

CHANGE<br />

Syntax<br />

CHANGE(string, old.substring, new.substring)<br />

Description<br />

The <strong>UniBasic</strong> CHANGE function replaces all occurrences of old.substring in string<br />

with new.substring. If old.substring is an empty string, the system does not change<br />

string. CHANGE supports multibyte languages.<br />

Parameters<br />

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

Parameter Description<br />

Examples<br />

In the following example, the program segment prints “<strong>UniBasic</strong> Release 6.1”:<br />

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

string Specifies the original text string.<br />

old.substring Specifies the text string to replace with new.substring.<br />

new.substring Specifies the text string with which to replace old.substring.<br />

CHANGE Parameters<br />

STRA = "<strong>UniBasic</strong> Release 6.1"<br />

OLDRELEASE = "6.0"<br />

NEWRELEASE = "6.1"<br />

STRB = CHANGE(STRA, OLDRELEASE,NEWRELEASE)<br />

PRINT STRB<br />

In the next example, the program segment prints “NEW STRC = A23A24A25A26”:<br />

STRC = "123124125126"<br />

PRINT "NEW STRC =":CHANGE(STRC,"1","A")

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

Saved successfully!

Ooh no, something went wrong!