5.1.3 Labels
A label is a 1- to 31-character identifier that you use to iden-
tify a block of statements. All label names must begin with a
letter; the remaining characters, if any, can be any combi-
nation of letters, digits, dollar signs ( $ ), underscores ( _ ), or
periods ( . ), but the final character cannot be a dollar sign.
Labels have the following advantages over line numbers:
When you use a label to mark a program location, you must
end the label with a colon ( : ). The colon is used to show that
the label name is being defined instead of referenced. When
you reference the label, do not include the colon. In the fol-
lowing example, the label names end with colons when they
mark a location, but the colons are not present when the
labels are referenced:
OPTION TYPE = EXPLICIT ! Require declarations
DECLARE INTEGER A
.
.
.
Outer_loop:
IF A <> B
THEN
Inner_loop:
IF B = C
THEN
A = A + 1
GOTO Outer_loop
ELSE
B = B + 1
GOTO Inner_loop
END IF
END IF
Labels have no effect on the order in which program lines
are executed; they are used to identify a statement or block of
statements.