GOTO

Contents


"Goto" is used to branch to a label.

 

Syntax

Gotolabel

 

Parameters

Element

Description

Restrictions

label

label may be preceded by the '$' character.

Must be defined in the routine.

 

Examples

infbox "I am going there ..."
Goto ETIQ_1
.... (end of routine)
ETIQ_1
infbox "I am there ..."

 

Description and comments

Goto is used to branch forward or back, breaking the sequence of a routine, essentially in order to make conditional loops or executions.

 

Comment:

Bearing in mind the number of possible control structures (For..To..Next, While..Wend, Repeat..Until, Case..When..Endcase, If..Elsif..Else..Endif, Break, Gosub, Call ) and the unreadability of programmes "packed" with Goto, you are strongly advised to avoid abuse of this instruction, attractive though it is on the face of it…

 

Associated errors

No associated error (an undefined label is detected when the routine is validated and not when it is run).

 

Associated key words

GOSUB - RETURN - CALL


CONTENTS


Copyright © Sage 1999 - 2007