Binary File Copying

 BBS: Inland Empire Archive
Date: 06-02-92 (21:08)             Number: 109
From: MATT HART                    Refer#: NONE
  To: ZACK JONES                    Recvd: NO  
Subj: Binary File Copying            Conf: (2) Quik_Bas
 >> relation to the DOS buffers.  Using REDIM rather than DIM will
 >> place Transfer into Far Memory rather than Dgroup, and using the

 ZJ> subject. I've captured it and will implement it - one day I'll
 ZJ> understand it! As always, thanks for the assist!

Most welcome.  Let's see if I can clarify some things.

QB 4.5 and PDS Near Strings split system memory into 3
parts:  Code space (for your EXE code), Data Group
(Dgroup), and the far heap.

     Code space is the amount your .EXE code PLUS any run-
time library needs from DOS.  Dgroup is a single 64K DOS
segment, and the far heap is everything that is left.
Dgroup is where everything except:
          EXE code
          TYPE Arrays (REDIM)
          Numeric Arrays (int, single, long, etc...) (REDIM)
          Fixed length string arrays (REDIM)
is held.  Variable length string and string arrays, simple numeric variables
(non-arrays), TYPE definitions, fixed length non-array (DIM
A AS STRING * 10), TYPE simple variables (DIM A AS MyType),
and lots of other junk is held.  If you don't do a
'$DYNAMIC or a REDIM, stuff you expect to be in the far
heap will be put into dgroup.  I always use REDIM and
'$DYNAMIC to be safe.  Dgroup, since it is only 64K, can
fill up fast.  If you use multiple CALLs and GOSUBs and
FUNCTIONs nested within each other, they all take up stack
space.  When you use LINK, you can increase the stack
space, but it steals from Dgroup to do it.  Most of my
programs end up with 25K or so of dgroup left.  But a
couple of really huge ones only have 10K or less.  And
there are things I'm going to have to add!
---
 * Origin: Midnight Micro!  V.32/REL  (918)451-3306 (1:170/600)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET