omron — GOTO program instruction

GOTO program instruction GOTO program instruction Syntax GOTO label Function Perform an unconditional branch to the program step identified by the given label. Parameter label Label of the program step to which execution is to branch. Step labels are integer values that range in value from 0 to 65535. Details This instruction causes program execution to jump to the line that contains the specified step label. Note that a step label is different from a line number. Line numbers are the numbers automatically assigned by the eV+ program editors to assist the editing process. Step labels must be explicitly entered on program lines where appropriate.

Modern, structured programming considers GOTO statements to be poor programming practice. Omron Adept suggests you use one of the other control structures in place of GOTO statements. Example The following program segment asks you to enter a number from 1 to 100. If the number input is not in that range, the GOTO 10 instruction at line number 27 causes execution to jump to step label 10 (at line number 23). 21 ; Get a number from the user 22 23 10 PROMPT "Enter a number from 1 to 100: ", number 24 25 IF (number 1) OR (number > 100) THEN 26 TYPE /B, /C1, *Invalid response*, /C1 27 GOTO 10 28 END Related Keywords DO program instruction EXIT program instruction FOR program instruction IF ...

THEN program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 271