Microsoft KB Archive/80824

= QB.EXE /AH Hang/&quot;String Space Corrupt&quot; Static to Dynamic Array =

Article ID: 80824

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q80824



SYMPTOMS
If you try to convert a static array to a huge dynamic array after a &quot;Subscript Out of Range&quot; error on the static array in the QB.EXE environment, you may receive a &quot;String Space Corrupt&quot; error or hang the system.



STATUS
Microsoft has confirmed this to be a bug in the QB.EXE environment in Microsoft QuickBasic version 4.5 for MS-DOS. This problem was corrected in the QBX.EXE environment in Microsoft Basic Professional Development System (PDS) version 7.1 for MS-DOS (fixlist7.10).



MORE INFORMATION
Starting the QuickBasic environment (QB.EXE) with the /AH (huge arrays) option allows dynamic non-variable-length string arrays to be larger than 64K. To make a huge array (an array greater than 64K), you must use the REM $DYNAMIC metacommand to force the array to use dynamic or far memory.

A problem occurs if you try to create a huge array and forget the REM $DYNAMIC metacommand. When you run the program, you will get a &quot;Subscript Out of Range&quot; error. When trying to fix the problem by adding the REM $DYNAMIC statement, you can get a &quot;String Space Corrupt&quot; error or hang the system.

Steps to Re-create Problem
 Invoke the QuickBasic environment with the /AH option to allow huge arrays.  In the QuickBasic environment, dimension an array as follows: DIM A(20000)  From the Run menu, choose Start, or press F5, to start the program. You will receive a &quot;Subscript Out of Range&quot; error. On the line just before the DIM (dimension) statement place the REM $DYNAMIC metacommand. Now run the program, and either you will receive a &quot;String Space Corrupt&quot; error, or your system will hang, or the results may be unpredictable.

Additional query words: QuickBas 4.50 fixlist7.10 buglist4.50

Keywords: KB80824

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.