UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

UniData DELETECOMMON, STACKCOMMON – For information, see the UniData Commands Reference manual. 1-163 UniBasic Commands Reference

CONTINUE Syntax CONTINUE Description The UniBasic CONTINUE command transfers control to the next iteration of a FOR/NEXT or LOOP/REPEAT statement. Tip: Use CONTINUE instead of GOTO in structured programs. Generally, the statements within a FOR/NEXT or LOOP/REPEAT structure execute one by one. If you want to break the sequence to begin the next iteration without a CONTINUE statement, you could use the GOTO statement. However, this makes the code more difficult to read and maintain. By using CONTINUE, you can clearly express the program logic without degrading program structure. Example In the following example, the program segment prints the value of I until I reaches eight. When I is equal to eight, the CONTINUE statement drops out of the FOR/NEXT loop, and the next statement in the program executes. FOR I = 1 TO 10 IF I > 8 THEN CONTINUE PRINT "I = ":I NEXT I The preceding code produces the following output: I = 1 I = 2 I = 3 ... I = 8 CONTINUE 1-164

UniData<br />

DELETECOMMON, STACKCOMMON – For information, see the UniData<br />

<strong>Commands</strong> <strong>Reference</strong> manual.<br />

1-163 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!