Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Line Identifiers
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Line Identifiers
■ Visual Basic supports two types of line identifiers (although their use is
not recommended):
Type Description
═══════════════════════════ ════════════════════════════════════════════
Alphanumeric line labels(1) • Consist of 1 to 40 letters and digits
• Must start with a letter
• Must be followed by a colon
• Are not case sensitive
• Cannot consist of Visual Basic keywords
• Can have blanks and tabs between the label
and the colon
• Three valid examples are:
ALPHA: ScreenSub: Alpha:
Line numbers(2) • Valid range is 0 - 65,529
• May begin in any column but must be first
character in the line
• A line may have only one label
• Visual Basic does not require each line in
a source program to have the same type of
identifier.
• Valid examples are:
1
200
300 PRINT "hello"
6500
─────────────────────────────────────────────────────────────────────────
■ You can mix alphanumeric labels and line numbers in the same program, and
you can use alphanumeric labels as objects of any Visual Basic statement
where line numbers are permitted except as the object of an IF...END IF
statement. See: ◄IF...END IF Statement►
■ A GOTO statement is required when using alphanumeric line labels as
objects in IF...END IF statements. For example:
IF A = 10 THEN GOTO IncomeData
See: ◄GOTO Statement► ◄IF...END IF Statement►
■ Using 0 as a line number is not recommended because:
• Error- and event-trapping statements interpret the line number 0 to mean
that trapping is disabled. See: ◄Error/Event Trapping Summary►
• RESUME 0 continues execution on the line where the error occurred,
not at line number. See: ◄RESUME Statement►
• Line numbers do not determine the order in which statements are
executed. For example, Visual Basic executes statements in the following
program in the order 100, 10, 5:
100 PRINT "The first line executed."
10 PRINT "The second line executed."
5 PRINT "The final line executed."
• Some previous versions of Basic expect the lines to be in numerical
order: 5, 10, 100.
• If you are trapping errors, the ERL function returns only the last line
number located before the error. See: ◄ERL Function►