beautypg.com

Goto – Visara Master Console Center Scripting Guide User Manual

Page 125

background image

Chapter 5 Script Commands

Scripting Guide

125

GOTO

Syntax:

GOTO *Label

Description:

Immediately transfers script execution to the specified label.

Action:

Script execution is transferred to the specified label.

Parameters:

*Label. Label literal. Name of the label to which execution is

transferred.

Returns:

N/A.

Notes:

1. The label must be in the current script.
2. The major difference between GOSUB and GOTO is:

-

GOSUB executes a subroutine, waits until it is done, and then
continues processing (perhaps by calling another subroutine).

-

GOTO immediately transfers the flow of script execution to

another step. There is no returning as with the GOSUB
command, and therefore is no nesting of GOTOs.

Generally, the use of GOTOs is considered bad programming style.

GOSUBs are preferred, to have a guaranteed program flow.
However, using GOTOs will not negatively impact the performance

or execution of the script.

Example:

GOTO *MVS01

See Also:

GOSUB, SCANP, START