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.
Program Line
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Program Line
■ Visual Basic program lines have the following syntax:
[line identifier] [statement] [:statement]...[remarks]
See: ◄Line Identifiers► ◄REM Statement► ◄Statements►
■ More than one statement can be placed on a line, but a colon (:) must
separate statements. For example:
FOR I = 1 TO 5: PRINT "g'day, mate": NEXT I
■ Programs created in Visual Basic are limited to 256 characters per line.
■ Visual Basic recognizes an underscore (_) as a line-continuation character
only if the underscore is preceded by a white-space character. Underscores
not preceded by a white-space character are assumed to be part of a
variable, constant, or event procedure name. For example:
Line-Continuation Character
IF (TestChar$ = " " OR TestChar$ = ".") AND LineNumber < 23 _
AND NOT EOF(FileNumber) THEN...
Part of Variable Name
IF ACCESSKEY_FORECOLOR <> 3 AND NOT EOF(FileNumber#) THEN...
■ If you load a file into the Visual Basic programming environment that
contains underscores, they are automatically assumed to be part of a
variable or event name unless preceded by a space ( _). When a program
contains this sequence of characters, Visual Basic removes all
underscores, and the previously "continued" lines are joined to form a
single line. For example:
This code created in your editor...
┌────────────────────────┐
│ IF (TestChar$ = "" _ │ ...is converted to a single line when
│ OR Test Char$... │ loaded into the Visual Basic
└────────────────────────┘ programming environment
│ ┌───────────────────────────────────────┐
└─────────────────► │ IF (TestChar$ = "" OR Test Char$... │
└───────────────────────────────────────┘
■ Underscores cannot be used to continue DATA or REM statements.
See: ◄DATA Statement► ◄REM Statement►