GOTO


The GOTO statement transfers processing control to the statement immediately following the referenced label.

    ••••• GOTO     ••••••••••••••••••••••••••••••
    (1)            (2)

(1) T/F execution conditions

(2) Label

Using the Statement

The LABEL to which the GOTO statement transfers processing control can be anywhere in the same event point as the GOTO.

Compilation Errors

A process compile error occurs if the referenced LABEL is not defined within the same event point as the GOTO statement, and also not defined in any ILF subroutines copied into the event point with the COPY statement.

Related Statements

COPY, GOSUB, LABEL, OVERFLOW, RETURN, TIMEOUT

Example

In the following example, “on account” payments are processed by invoice until no more payment amount is left to apply.

          LABEL    :GET NEXT APPLY TO
          *        any more to apply?
          IF       TAR WORK ON ACCOUNT AMOUNT     EQ     0

    T     GOTO     :END PROCESS ON ACCOUNT
          *        (process 'on account' payment)

          GOTO     :GET NEXT APPLY TO
          *

          LABEL    :END PROCESS ON ACCOUNT
          *        (perform other processing)