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.

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 HI THERE on the system<br />

printer:<br />

PRINTER ON<br />

PRINT "HI THERE"<br />

In the next example, the program statement sends the value of variable X concatenated<br />

to "X = " to the file specified by unit 10:<br />

PRINT ON 10 "X = ":X<br />

In the next example, the @ function is included with a terminal option. -1 clears the<br />

screen before printing.<br />

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

ON num.expr Specifies a target print file. If you do not use the ON clause, the data is<br />

printed based on the last PRINTER command executed:<br />

PRINTER OFF – The data prints on the display terminal.<br />

PRINTER ON – The data prints on the system printer.<br />

print.expr Specifies an expression to print. It can be any valid <strong>UniBasic</strong><br />

expression. If you do not specify a print.expr, a PRINT statement sends<br />

a line feed character to the printer or file.<br />

PRINT Parameters<br />

PRINT @(-1):"Enter true or false: "<br />

INPUT answer,5_<br />

In the next example, the comma separation character prints X, Y, a string separated<br />

by tabs, X+Y, tabs twice, then prints another string, and finally print the average of<br />

X and Y using the INT function:<br />

X = 5 ; Y = 7<br />

PRINT X,Y,"Total = ":X+Y,,"Average = ":INT((X+Y)/2)<br />

The result is:<br />

5 7 Total = 12 Average = 6

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

Saved successfully!

Ooh no, something went wrong!