PreviousNext
Help > PROGRAM CONTROL STRUCTURES > Labels
Labels

Rittle allows placing labels in the source text. A label in Rittle is a single valid identifier starting with a ‘!’ character. It is a marked place in the program, where the execution can be taken by using the name of that marked place.

Jumping to a label is done by placing its name as a normal word. Any time a word which is a known label, is reached, the execution unconditionally jumps to the spot marked with that label.

Here is a small example of a loop created by using a jump label:

 

var small a=0;

!loop

    ……. Something to do here …….

    a=a+1;

if a<10; loop; endif;

 

Note that there is no semi-colon character after the label. This is because the label itself does not make a valid statement, but rather marks the beginning of one. Jumping to a label however, is a valid statement in its own right because it instructs a certain action to be taken. Hence it does have a closing semi-colon.