Previous Topic Next topic Print topic


Goto

Use

Moves the execution pointer to a specified statement.

Command Syntax

GOTO statement-id

where:

statement-id
Can be a line number, a simple statement label, or a statement label followed by a line number offset or statement offset

Description

The GOTO command moves the execution pointer to a specified statement. Program execution resumes at this point when a Continue or Step is issued. The named statement must exist in the current program block.

Note:

It is not valid to put an activation number on the statement-id. If the activation number of an existing previous block invocation is put on the statement-id, it is ignored; otherwise, the following error message is displayed:

specified activation does not
			 exist

It is not possible to use Goto to go to the %EXIT point of a block. The RETURN command, however, can be used to go to the %EXIT point.

When a Goto is executed, the debugger displays the current execution point.

Example

In this example, the execution point is changed to line 21 from the previous execution point as displayed by the Where command.

CodeWatch> WHERE
Current execution point is PRIMES.READ_INPUT\%ENTRY 
CodeWatch> GOTO 21
Execution point is now PRIMES.READ_INPUT\21
Previous Topic Next topic Print topic