This is an old revision of the document!


Jump statement

The jump statement transfers the control to the line of code identified with the label.

Labels in Alvis are identifiers followed by a colon. A label must start with a lower case letter.

It is necessary to put at least one statement after a label. In other words, a label cannot be followed by a closing curly bracket.

The jump statement is a single-step statement.

The jump statement should be used carefully, e.g. you cannot jump from one procedure to another.

jump label;

Listing 1. Loop statement syntax

x = 10;
y = x;
abc:
  y = y - 1;
  x = x * y;
  jump abc;

Listing 2. Jump statement example

Go back