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.

EXIT<br />

Syntax<br />

EXIT<br />

Description<br />

The <strong>UniBasic</strong> EXIT command terminates a FOR/NEXT or LOOP/REPEAT<br />

structure and transfers control to the following statement. As with the CONTINUE<br />

statement, EXIT forms well structured programs.<br />

Tip: Use EXIT in structured programs instead of GOTO. This makes the code easier<br />

to read and maintain.<br />

Example<br />

In the following example, the program segment exits the FOR/NEXT loop when I is<br />

greater than 8:<br />

FOR I = 1 TO 10<br />

IF I > 8 THEN EXIT<br />

PRINT "I = ":I<br />

NEXT I<br />

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

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

CONTINUE, FOR/NEXT, LOOP/REPEAT<br />

EXIT 1-275

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

Saved successfully!

Ooh no, something went wrong!