For more information, refer to the $ZERROR special variable. If you specify a nonexistent routine, Caché issues a error message. Unlike the DO command, GOTO does not return to the invoking program following routine execution. If the routine has been modified, Caché loads the updated version of the routine when GOTO invokes the routine.
Caché loads the routine from disk and continues execution at the first line of executable code within the routine. ^routine specifies a routine that resides on disk. The optional +offset is a nonnegative integer that specifies the number of lines after the label at which execution is to start. Caché loads the routine from disk and continues execution at the indicated label. Label+ offset^ routine specifies a line label within the named routine, which resides on disk. However, offset does count all Embedded SQL lines, including all blank lines. The offset counts lines of code (including label lines), and counts comment lines offset does not count blank lines and blank lines within comments. Label+ offset specifies a line label within the current routine. You can specify location as a single value or as a comma-separated list of values (with postconditionals) and can take any of the following forms: The point to which control will be transferred. For further details, refer to Command Postconditional Expressions in Using Caché ObjectScript. If the postconditional expression is false (evaluates to zero), Caché skips that argument and evaluates the next argument (if there is one) or the next command. If the postconditional expression is appended to an argument, Caché executes the argument if the postconditional expression is true (evaluates to a nonzero numeric value). Caché does not execute the GOTO command if the postconditional expression is false (evaluates to zero). If the postconditional expression is appended to the GOTO command keyword, Caché executes the GOTO command if the postconditional expression is true (evaluates to a nonzero numeric value). Copy link to this section Arguments Copy link to this section pcĪn optional postconditional expression that can make the command conditional. You can specify a $CASE function as a GOTO command argument. You can use GOTO location from the Terminal prompt to resume an interrupted program at a different location. If you specify a postconditional expression on either the command or the argument, Caché transfers control only if the postconditional expression evaluates to TRUE (nonzero). GOTO with the argument location transfers control to the specified location. Copy link to this section GOTO With an Argument
See Processing Errors at the Terminal Prompt in the “Error Processing” chapter of Using Caché ObjectScript. Use the QUIT 1 command, then argumentless GOTO to resume after a NEW.Īrgumentless GOTO can also be used at the Terminal prompt to continue execution after an error.
If a NEW command is in effect when you issue an argumentless GOTO, Caché issues a error, and the new context is maintained. Note that there must be two spaces after the BREAK command.