07.05.2015 Views

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

222 BRONZE <strong>Edition</strong> <strong>Guide</strong><br />

The following example illustrates this use.<br />

will yield:<br />

PRINT USING "#.## plus #.## equals #.##": 1.2, 2.3, 1.2+2.3<br />

1.20 plus 2.30 equals 3.50<br />

If there are fewer values than format items, the unused format items are ignored, but<br />

the last intervening literal string is printed. Thus,<br />

will yield<br />

PRINT USING "#.## plus #.## equals #.##": 1.2, 2.3<br />

1.20 plus 2.30 equals<br />

If you need to have one of the special formatting characters appear in the output – for<br />

example, if you want to have a final period, as in the last example – you can simply add<br />

a one-character field to the format string and add the quoted-string “.” to the PRINT<br />

statement. Thus,<br />

LET x = 1.2<br />

LET y = 2.3<br />

PRINT USING "#.## plus #.## equals #.## #": x, y, x+y, "."<br />

will yield<br />

1.20 plus 2.30 equals 3.50 .<br />

The PRINT USING statements found in <strong>True</strong> <strong>BASIC</strong> allow you to format your calculated<br />

results or data in many easy-to-understand formats. Investing time in learning<br />

the many capabilities of these statements will pay rich dividends.

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

Saved successfully!

Ooh no, something went wrong!