GO-TO STATEMENT

Go-to is a statement used to performs a one-way transfer of control to another line of code. Allows user to create loops without claiming function, loops inside loops and more.

There are two constructions that realise go-to functionality.

FU:E# - Trigger based go-to
Go # triggers of same kind up or down. Triggers of same kind are those with the same name (2 letters) and the same parameters.
!?OB5/5/0 and !?OB0/0/0 are different. !?OB5/5/0 and !$OB5/5/0 are different too. But !?OB5/5/0; and !?OB5/5/0&v1=0; are of the same kind.

Example 1:
!?FU255; [1]
...
!?FU255; [2]
(...)
!!FU&1:E-1; [go to 2]
!!FU&2:E-2; [go to 1]
!!FU&3:E0; [usual FU:E - exit function]

Example 2: A single loop:
!?FU255;
!!VRy1:S0;

!?FU255&y1<100;
(...)
!!VRy1:+1;
!!FU:E-1;

This is equivalent to while y1<100 do { (...) y1 = y1 + 1; }
You can also make one loop inside another and anything you could do with regular DO, but much faster and without a need for a free function number. You can place FU:G99999; at the end of a function and you would be able to insert it into multiple scripts - it would be executed only once anyway.

la#, go# - Label based go-to
Use !!la# to setup a label, and !!go# to jump to given label.
This GOTO is preferrable. There may be 50 labels (0...49).

Example 1:
!?FU255;
!!la0:; [label 0]
(...)
!!la1:; [label 1] (...)
!!go0&1:; [go to label 0] !!go1&2:; [go to label 1]

Example 2: A single 'for' loop:
!?FU255;
!!VRy1:S0;
!!la0:;  [label 0]
!!if&y1<100:;
  (...)
  !!VRy1:+1;
  !!go0:;  [goto label 0]
!!en:;

This is equivalent to while y1<100 do { (...) y1 = y1 + 1; }
You can also make one loop inside another and anything you could do with regular DO, but much faster and without a need for a free function number. Labels are completely local, can't be accessed from any other trigger, including !?FU called within this context.