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.

STATUS Function Return Values<br />

After you execute FMT, the STATUS function returns one of the values described in<br />

the following table.<br />

Value Description<br />

0 Successful completion.<br />

Examples<br />

In the following example, the program segment prints the variable SS.NUM as a<br />

formatted string using a pattern mask. The result printed is a string with 11 characters,<br />

left-justified:“543-70-4128”.<br />

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

1 String expression is invalid or exceeds the allowable string size.<br />

2 Conversion code is invalid.<br />

STATUS Function Return Values<br />

SS.NUM=543704128<br />

PRINT FMT(SS.NUM,"11L###-##-####")<br />

In the next example, the program segment prints the variable NUM as a 12-character,<br />

right-justified number with two decimal places, preceded by a dollar sign and<br />

composed with commas. The segment prints the value “$16,526.00”.<br />

NUM = 16526<br />

PRINT FMT(NUM, "12R2$,")<br />

In the next example, the program segment formats the string OUT.STRING with 0 as<br />

the fill character, right-justified, and in a column of four spaces. The segment prints<br />

0044.<br />

OUT.STRING = 44<br />

OUT.STRING = FMT(OUT.STRING,"4\0R")<br />

PRINT OUT.STRING<br />

In the next example, the program statement saves the variable STR as a rightjustified,<br />

eight column string:<br />

STR = STR "R#8"

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

Saved successfully!

Ooh no, something went wrong!