Microsoft KB Archive/38276

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 17:55, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


"Out Of Memory" During CHAIN Using Large COMMON Block

Article ID: 38276

Article Last Modified on 8/16/2005



APPLIES TO

  • Microsoft QuickBasic 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBasic 4.5 for MS-DOS
  • Microsoft BASIC Compiler 6.0
  • Microsoft BASIC Compiler 6.0b



This article was previously published under Q38276

SUMMARY

The two programs shown below demonstrate that a program can run out of memory when CHAINing to another program if there is insufficient memory to copy the COMMON data. If run from within the QB.EXE environment, the error is simply "Out of memory," while the error message "Out of memory during chain" is produced when the programs are run as .EXE programs. To solve the error, you must use a smaller COMMON block.

This information applies to QuickBasic Versions 4.00, 4.00b, and 4.50, and Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2.

MORE INFORMATION

The following are code examples:

'chain1.bas
DIM a#(5000)
COMMON a#(), b#(), c#()
 x = FRE(-1) - 1000
 PRINT FRE(-1)
DIM b#(x / 16), c#(x / 16)
PRINT FRE(-1)
CHAIN "chain2"
                
'chain2.bas
DIM a#(5000)
COMMON a#(), b#(), c#()
PRINT FRE(-1)
PRINT "Chain complete"
                


Additional query words: QuickBas BasicCom

Keywords: KB38276