When Out of Memory in QBX 7.00, Instant Watch Reruns Program (63195)






This article was previously published under Q63195

SYMPTOMS

Trying to set an Instant Watch variable on a large variable-length string in QBX.EXE can cause QBX to restart the program from the beginning if the program is almost out of memory. When the program is almost out of memory, QBX fails to add the watch and instead reruns the program.

STATUS

Microsoft has confirmed this to be a bug in the QBX.EXE environment that comes with Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To reproduce the problem, the following conditions must be duplicated:

  1. There must be less than 15K of memory free. Use PRINT FRE(-1) to show this.
  2. Create a large string, such as the following:
          a$=STRING$(10000,62)
    						
  3. Stop the program just after the string is assigned. For example, step through the program with the F8 key, or put a breakpoint on the line after you create the string.
  4. Move the cursor back up to the string variable.
  5. Press SHIFT+F9 to set an Instant Watch.
  6. If QBX allows you to set the watch, either decrease the amount of free memory, or keep setting Instant Watches on the same variable. Eventually, QBX will fail to add the watch, and will rerun the program from the beginning.

Code Example

Use the above steps to reproduce the problem with the code below. The following code was used to reproduce this problem on a machine where CHKDSK.COM showed 508,200 bytes free:
   REM $DYNAMIC
   CLEAR
   REDIM array1(19000) AS DOUBLE
   PRINT
   a$ = STRING$(10000, 33)
   PRINT a$       ' Stop the program here. Move the cursor to a$.
   PRINT FRE(-1)  ' Press SHIFT+F9 several times.
   PRINT
   PRINT
   PRINT
   PRINT
   PRINT
   PRINT
				

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