statement labels

statement labels are used as the destination of a goto or gosub statement.

A statement label consists of a numeric or alphanumeric string of characters placed at the beginning of any BASIC statement or by itself on a line in the program.

BASIC requires labels only on those statements used as destinations for goto or gosub statements.

Numeric statement labels can be any of these formats:

  • 10

  • 1

  • 100.5

  • 01

  • 001

  • 10.02

Each of the above labels is unique.

Alphanumeric statement labels must begin with an alpha character. Any subsequent character in the label can be alphabetical or numeric. An alphanumeric statement label must be followed by a : . If a statement is placed on the same line, it must be separated from the statement label by one or more spaces.

Because D3 allows null statement lines, a statement label can stand by itself on a line.

Syntax

statement.label{:} {BASIC statement{s}}

Example(s)

Label Description
1000 * start main loop Numeric statement label.
mainline: Alphabetical statement label.