GoTo-uttrykket

Held fram programutføringa inne i ein Sub ellerFunction frå den prosedyren som er vist på ein etikett.

Syntaks:


GoTo label[:]

Parametrar:

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 (":").

Ă…tvaringsikon

Du kan ikkje bruka uttrykket GoTo for ĂĄ gĂĄ ut av ein Sub eller Function.


Eksempel:


    Sub/Function
       ' uttrykksblokk
       GoTo Label1
    Label2:
       ' uttrykksblokk
       Exit Sub/Function
    Label1:
       ' uttrykksblokk
       GoTo Label2
    End Sub/Function