GoTo Expressió

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

Sintaxi:


GoTo label[:]

Paràmetres:

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

Utilitzeu l'expressió GoTo per instruir al LibreOffice Basic que continue l'execució del programa en un altre lloc dins del procediment. La posició s'ha d'indicar amb una etiqueta. Per establir una etiqueta, un nom i acabeu-lo amb dos punts (":").

Icona d'avís

You cannot use the GoTo statement to jump out of a Sub or Function.


Exemple:


    Sub/Function
       ' statement block
       GoTo Label1
    Label2:
       ' statement block
       Exit Sub/Function
    Label1:
       ' statement block
       GoTo Label2
    End Sub/Function

Ens cal la vostra ajuda!