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.

+<br />

Syntax<br />

expr + expr<br />

+expr<br />

Description<br />

In the first version of the syntax, the + arithmetic operator adds the two numbers on<br />

either side of the operator.<br />

In the second version of the syntax, + acts as a unary plus operator (same as multiplying<br />

by +1).<br />

Example<br />

The following program segment is taken from the sample program in “Appendix A -<br />

Sample Program” in Developing <strong>UniBasic</strong> Applications. The third statement places<br />

the cursor at the location computed by 9+ENTRY, then the program displays the<br />

seventh element of the array ORDER.REC at that location.<br />

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

FOR ENTRY = 1 TO NUM_ENTRIES<br />

NEW.PRICE = ""<br />

DISPLAY @(10,9+ENTRY):OCONV(ORDER.REC,"MR2$,"):<br />

INPUT @(45,9+ENTRY):NEW.PRICE<br />

NEW.PRICE = OCONV(NEW.PRICE,"MCN")<br />

IF NEW.PRICE # '' AND NUM(NEW.PRICE) THEN<br />

ORDER.REC = NEW.PRICE<br />

NEED.TO.WRITE = 1<br />

END<br />

NEXT ENTRY<br />

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

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

ABS, NEG, SADD, SUM

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

Saved successfully!

Ooh no, something went wrong!