11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

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

-<br />

Syntax<br />

expr -expr<br />

-expr<br />

Description<br />

In the first version of the syntax, the - arithmetic operator subtracts the expr on the<br />

right from the expr on the left of the operator.<br />

In the second version of the syntax, - acts as a unary minus operator, which produces<br />

the same result as multiplying by -1.<br />

Examples<br />

In the following example, VAR2 is subtracted from VAR1 and the result is assigned<br />

to the variable X:<br />

X = VAR1 - VAR2<br />

In the next example, the - operator is used as the unary minus and changes the sign<br />

of VAR:<br />

VAR = -VAR<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

ABS, NEG

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

Saved successfully!

Ooh no, something went wrong!