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.

Parameter Description<br />

Examples<br />

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

“Sample Program,” in Developing <strong>UniBasic</strong> Applications. This segment prints multivalues<br />

from the ORDERS file when a client has ordered multiple items.<br />

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

statements Specifies the statements to carry out for each loop.<br />

UNTIL |<br />

WHILE expr<br />

statements<br />

Specifies a condition, expr, to test after each loop. If the UNTIL keyword<br />

is used, the loop continues until expr is true. If the WHILE keyword is<br />

used, the loop continues until expr is not true. In either case, when the loop<br />

stops, the statements are executed before the program continues.<br />

NEXT var The NEXT statement defines the end of the block of statements to be<br />

repeated. The optional var is the same variable as in the beginning of the<br />

FOR/NEXT statement.<br />

FOR/NEXT Parameters (continued)<br />

DISPLAY_DATA:<br />

* Display the current information in the desired record. This is<br />

* determined by the number the user entered (ORDER_NUMBER).<br />

.<br />

.<br />

. FOR ENTRY = 1 TO NUM_ENTRIES<br />

PRODUCT_NUMBER = ORDER.REC<br />

COLOR = ORDER.REC<br />

QUANTITY = ORDER.REC<br />

PRICE = OCONV(ORDER.REC,"MD2$,")<br />

IF PRODUCT_LINE = '' THEN<br />

PRODUCT_LINE = PRODUCT_NUMBER "R#10"<br />

COLOR_LINE = COLOR "R#10"<br />

QUANTITY_LINE = QUANTITY "R#10"<br />

PRICE_LINE = PRICE "R#10"<br />

END ELSE<br />

PRODUCT_LINE := " ":PRODUCT_NUMBER "R#10"<br />

COLOR_LINE := " ":COLOR "R#10"<br />

QUANTITY_LINE := " ":QUANTITY "R#10"<br />

PRICE_LINE := " ":PRICE "R#10"<br />

END<br />

NEXT ENTRY

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

Saved successfully!

Ooh no, something went wrong!