BUG: WIDTH Not Reset in Mac QuickBasic Interpreter; Use 255 (59764)






This article was previously published under Q59764

SYMPTOMS

The WIDTH for the output window in the interpreter in QuickBasic Version 1.00 for the Macintosh is not reset at the end of program execution. This can cause problems with subsequent program executions. For example, with a subsequent program that LOCATEs to a specific column and PRINTs a string, the string is placed on the next line if it exceeds the WIDTH set in the previous program. This problem does not occur in compiled applications.

To work around the problem, place a WIDTH 255 statement at the beginning of the program (or execute WIDTH 255 in the Command window). This resets the WIDTH to the default and has the effect of an "infinite" width.

Microsoft has confirmed this to be a bug in Microsoft QuickBasic Version 1.00 for the Macintosh . We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This problem affects the sample program on Pages 408 and 409 of the "Microsoft QuickBasic for Macintosh : Language Reference" manual. On the first run of this program, everything displays correctly, but on the second execution, the first PRINT statement is written at the beginning of the next line.

Code Example

The following code example demonstrates the problem when run multiple times:
   LOCATE 1, 30
   PRINT "Hello"
   WIDTH 30
   END
				
On the first run of the above program, it displays "Hello" beginning at the 30th column of the 1st line of the output window. The second and ensuing runs of the program display "Hello" on the beginning of the 2nd line.

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: kbbug KB59764