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 />

CASE expression1 Any <strong>UniBasic</strong> conditional expression. If the expression is true,<br />

execute statements1.<br />

statements1 The <strong>UniBasic</strong> statements to execute if expression1 is true.<br />

CASE expression2 Any <strong>UniBasic</strong> conditional expression. If the expression is true,<br />

execute statements2.<br />

statements2 The <strong>UniBasic</strong> statements to execute if expression2 is true.<br />

CASE 1<br />

statements<br />

Examples<br />

Note: An example of the use of CASE is included in the sample program in “Appendix<br />

A - Sample Program” of Developing <strong>UniBasic</strong> Applications.<br />

In the following example, if the variable DUE.DATE is greater than the system date,<br />

the program calls the subroutine PRINT.OVERDUE. (Notice that both dates are in<br />

internal format.) If DUE.DATE is less than or equal to the system date, the program<br />

prints the message “Okay” on the display terminal.<br />

BEGIN CASE<br />

CASE DUE.DATE > DATE()<br />

GOSUB PRINT.OVERDUE:<br />

CASE DUE.DATE

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

Saved successfully!

Ooh no, something went wrong!