Improper IF Statement Syntax Can Hang QB.EXE 4.00 Environment (47643)






This article was previously published under Q47643

SYMPTOMS

An illegally formed IF statement may hang the QuickBasic environment during the binding stage. When you move the cursor to the IF statement, the reserved words will not be converted to uppercase letters, and there will be no syntactic error message generated.

The computer hangs only when the program is executed inside the QuickBasic environment. The compiler correctly generates several error messages for the illegally formed IF statement.

STATUS

Microsoft has confirmed this to be a bug in the QB.EXE editor in QuickBasic Versions 4.00, 4.00b, and 4.50, and in the QB.EXE editor that comes with Microsoft Basic Compiler Versions 6.00 and 6.00b (buglist6.00, buglist6.00b). This problem was corrected in the QBX.EXE environment of Microsoft Basic Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2 (fixlist7.00). QBX.EXE correctly identifies that the syntax is in error.

MORE INFORMATION

Code Example

The following code sample reproduces the problem:
   REM *** SAMPLE PROGRAM

   if a$ = "1" goto d$ = "larry"
				
When you type this program in the QB.EXE editor and press the ENTER key, reserved words stay as entered and fail to automatically shift to uppercase letters. Running the program hangs the computer.

If you attempt to enter the above code in the QBX.EXE environment of Basic PDS 7.00, the environment correctly highlights the second string variable and reports "Expected: Label or Line-number".

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