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.

Parameters<br />

The following table describes each parameter of the syntax.<br />

Paramete<br />

r Description<br />

Note: In BASICTYPE M or P, if expr is nonnumeric or less than 1, UniData bypasses<br />

the GOTO clause and the next program statement executes.<br />

Example<br />

In the following example, the program statement transfers program control to the<br />

statement label TEST if the variable X is less than or equal to 1. If X is 2, UniData<br />

transfers control to statement label 2500. If X is greater than or equal to 3, UniData<br />

transfers control to statement label YESNO.<br />

ON X GOTO TEST,2500, YESNO<br />

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

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

GOSUB, GOTO, ON/GOSUB<br />

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

expr Specifies a numeric expression. UniData evaluates the expression, and then<br />

truncates it to an integer. Control passes to a statement label based on the<br />

following rules:<br />

If expr is less than or equal to 1, UniData transfers program control to the label<br />

starting at the first label in the list. If the number is 2, UniData transfers control<br />

to the label starting at the second label, and so forth.<br />

If expr is higher than the number of labels, UniData transfers control to the last<br />

label in the list.<br />

If expr is nonnumeric, control transfers to the first label.<br />

label Specifies a statement label or multiple statement labels.<br />

: Optional. A colon is required to identify a nonnumeric label in the statement<br />

label itself only, not in the reference to it in the ON/GOTO statement.<br />

ON/GOTO Parameters

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

Saved successfully!

Ooh no, something went wrong!