GoTo Statement

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

αžœαžΆαž€αŸ’αž™β€‹αžŸαž˜αŸ’αž–αž“αŸ’αž’ αŸ–


GoTo label[:]

αž”αŸ‰αžΆαžšαŸ‰αžΆαž˜αŸ‰αŸ‚αžαŸ’αžš αŸ–

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

αžšαžΌαž”β€‹αžαŸ†αžŽαžΆαž„β€‹αž–αŸ’αžšαž˜αžΆαž“

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


αž§αž‘αžΆαž αžšαžŽαŸ αŸ–


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

Please support us!