KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q31159: "Out of Data Space

Article: Q31159
Product(s): See article
Version(s): 2.00 2.01 3.00 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | B_BasicCom | mspl13_basic
Last Modified: 21-DEC-1989

When a program is running, each file OPENed with the OPEN statement
takes up memory for the file buffer in DGROUP. If you specify a large
record length (with the LEN= clause), a corresponding large space will
be taken up in DGROUP.
   When OPENed file buffers consume all of DGROUP memory at run time,
one of the following error messages will display:

Version   In QB.EXE Environment     From .EXE Compiled Program

3.00      "Out of memory"             "Out of memory in module"
4.00      "Out of data space"         "Out of memory in module"
4.00b     "Out of data space"         "Out of memory in module"
4.50      "Out of data space"         "Out of memory in module"

   The Microsoft BASIC Compiler Versions 6.00 and 6.00b for MS-DOS and
OS/2 will behave like QuickBASIC Version 4.00b.
   To work around this problem, do the following:

   1. CLOSE each file before OPENing the next. Closing the file will
free up the DGROUP memory that it used.
   2. Use the CLEAR command to CLOSE all files and erase all
variables.
   3. Reduce the record length size (LEN=reclen) in the OPEN
statement.
   4. Make numeric arrays $DYNAMIC instead of $STATIC. This will leave
more space in DGROUP.

   The following code demonstrates the problem:

CLS : CLOSE
PRINT "Amount of available string space";FRE("")
OPEN "z1" FOR RANDOM AS 1
OPEN "z2" FOR RANDOM AS 2 LEN = 5000;
OPEN "z3" FOR OUTPUT AS 3
OPEN "z4" FOR OUTPUT AS 4 LEN = 5000
OPEN "z6" FOR BINARY AS 6
PRINT "Amount of available string space";FRE("")

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.