QB.EXE/QBX.EXE Incorrectly Allows GO As a Variable (62266)






This article was previously published under Q62266

SYMPTOMS

The QB.EXE and QBX.EXE environments incorrectly allow the keyword GO to be used as a variable. The BC.EXE compiler correctly flags this usage as a syntax error.

STATUS

Microsoft has confirmed this to be a bug in the QB.EXE environment in Microsoft QuickBasic versions 4.00, 4.00b, and 4.50; in Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS (buglist6.00, buglist6.00b); and in the QBX.EXE environment in Microsoft Basic Professional Development System (PDS) version 7.00 for MS-DOS (buglist7.00). This problem is corrected in Microsoft Basic PDS 7.10 (fixlist7.10).

MORE INFORMATION

This error is not trapped in the QB.EXE/QBX.EXE environments because GO is not a keyword on its own. GO must always be used with the keywords TO or SUB to complete the combined phrases GOTO and GOSUB. Because QB.EXE and QBX.EXE both format the code as it is entered, "GO TO" is changed to be "GOTO". Thus, GO on its own is not checked during QBX.EXE's final pass in creating the internal pseudocode (pcode).

The following code example fails to give an error in the QB.EXE and QBX.EXE environments, but correctly causes a "Syntax error" when compiled with BC.EXE:
   GO = 1
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB62266