Microsoft KB Archive/34981

From BetaArchive Wiki
Knowledge Base

"Expected End of Statement," Line Label with Leading Numeric

Article ID: 34981

Article Last Modified on 11/21/2006

This article was previously published under Q34981


QuickBasic Versions 4.00, 4.00b and 4.50 do not allow a leading numeric character in a line label. QuickBasic assumes that any line label starting with a number to be a line number followed by an executable statement. If such a line label is entered within the QuickBasic Version 4.00 or 4.00b editing environment, an "Expected End of Statement" error message is displayed. For a detailed explanation, refer to Page 9 of the "Microsoft QuickBasic Compiler 4.0: Basic Language Reference" manual.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2, and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.


QuickBasic Version 3.00 does allow leading numbers in a line label. To convert a QuickBasic Version 3.00 program to QuickBasic Version 4.00, 4.00b or 4.50, select the Change option in the Search menu to replace all occurrences of the improper label with a valid line label or line number.

The following program generates an "Expected End of Statement" error:

PRINT "hello"
GOTO 2line
        PRINT "goodbye"

Additional query words: QuickBas BasicCom

Keywords: KB34981