Contido
Índice 🔎︎

# Instrución GoTo

Continues program execution within a Sub or Function at the procedure line indicated by a label.

## Sintaxe:

    GoTo label[:]

## Parámetros:

label: A line identifier indicating where to continue execution. The scope of a label is that of the routine it belongs to.

Use the GoTo statement to instruct LibreOffice Basic to continue program execution at another place within the procedure. The position must be indicated by a label. To set a label, assign a name, and end it with a colon (":").

Non é posíbel usar a instrución GoTo para saltar fóra dun Sub ou función.

## Exemplo:

        Sub/Function
           ' bloque de instrucións
           GoTo Label1
        Label2:
           ' bloque de instrucións
           Exit Sub/Function
        Label1:
           ' bloque de instrucións
           GoTo Label2
        End Sub/Function

Temas relacionados

Instrución GoSub...Return

On...GoSub Statement; On...GoTo Statement