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.

[]<br />

Syntax<br />

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

string.expr [num.expr1,num.expr2] = expr<br />

expr = string.expr [num.expr1, num.expr2]<br />

Description<br />

The <strong>UniBasic</strong> [] (square brackets) function extracts or replaces strings.<br />

Null Value Handling<br />

With null value handling on, when <strong>UniBasic</strong> encounters the null value in a command<br />

parameter where a number is expected (num.expr1, num.expr2), it displays a warning<br />

message and uses 0.<br />

Note: In BASICTYPE M and P, the [] (square brackets) function can remove a<br />

substring entirely and can also remove parts of the substring.<br />

Parameters<br />

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

Parameter Description<br />

string.expr In the first form, the function replaces part or all of string.expr. In the<br />

second form, the function extracts part or all of string.expr.<br />

num.expr1 Indicates the starting position for the operation. It refers to the character<br />

position where the replacement or extraction operation occurs.<br />

num.expr2 Indicates the number of characters involved in the operation. If UniData<br />

performs an extraction, it returns that number of characters. If UniData<br />

performs a replacement, it replaces that number of characters.<br />

[ ] Parameters

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

Saved successfully!

Ooh no, something went wrong!