KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q42476: "Subscript Out of Range" Then Add REM $DYNAMIC Hangs QB 4.50

Article: Q42476
Product(s): See article
Version(s): 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S890228-60 buglist4.50 | mspl13_basic
Last Modified: 26-FEB-1990

The following series of actions hang the QuickBASIC 4.50 editor when
dimensioning a $DYNAMIC huge array:

1. Start QB with the /AH switch.

2. Dimension a STATIC array larger than 64K of any type of data except
   variable length strings, as follows:

      'example code. Do not use the metacommand yet.
      DIM  ARRAY1(32000) AS SINGLE ' 128000 bytes

3. Run the program (press SHIFT+F5). This produces the error "Subscript
   out of range," as expected.

4. Add REM $DYNAMIC before the DIMension.

5. Run the program (press SHIFT+F5). The machine usually hangs at this
   point. Occasionally, it produces the error message "String Space
   Corrupt" and returns to the DOS prompt.

This problem does not occur in the QuickBASIC Versions 3.00, 4.00, or
4.00b editors and does not apply to .EXE applications compiled with
BC.EXE in 4.50.

Microsoft has confirmed this to be a problem in Microsoft QuickBASIC
Version 4.50. The problem was corrected in Microsoft BASIC
Professional Development System (PDS) Version 7.00 (fixlist7.00).
When the program is run a second time, it does not hang or produce an
error message.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.