BC.EXE May Hang Using Single Quotation Marks in String CONST (65569)






This article was previously published under Q65569

SYMPTOMS

If you use an editor other than QB.EXE to write a program and BC.EXE hangs at compile time, one possible cause is the use of single quotation marks to delimit a string literal when declaring a string CONST. Using single quotation marks to delimit a string constant rather than double quotation marks is incorrect syntax and is flagged by QB.EXE, but may cause the BC.EXE compiler to hang. In QuickBasic version 3.00, QB.EXE will also hang as a result of using single quotation marks.

This problem occurs in Microsoft QuickBasic versions 3.00, 4.00, 4.00b, and 4.50, and in Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b) for MS-DOS and OS/2. This problem was corrected in Microsoft Basic Professional Development System (PDS) version 7.00 (fixlist7.00) for MS-DOS and OS/2.

MORE INFORMATION

When the following one-line program is written with an editor other than QB.EXE and compiled using BC.EXE, the BC.EXE compiler will hang. (In QuickBasic 3.00, QB.EXE will hang):
   CONST A$ = 'Hello World'
				
The compiler may generate the error "R6000: internal stack overflow" before it hangs, or it may go into an infinite loop, generating "R6000: Internal stack overflow" errors.

To work around this problem, use the correct syntax, as follows:
   CONST A$ = "Hello World"
				
Note: The CONST statement was first introduced in QuickBasic 3.00.

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