Large Array sizes 
Author Message
 Large Array sizes

I am trying to write a program that simulates a forest.  With this I need
an array that is able to keep track of about 90,000 trees.  But I get a
'too large' error when I try for anything over 4,000.  Is there a way to
get around this in Pascal?
I have Borland's Turbo Pascal for Windows
Brian



Sun, 28 Nov 1999 03:00:00 GMT  
 Large Array sizes

Quote:

>I am trying to write a program that simulates a forest.  With this I need
>an array that is able to keep track of about 90,000 trees.  But I get a
>'too large' error when I try for anything over 4,000.  Is there a way > to get around this in pascal?

The problem is not Pascal but DOS real mode, which places a limit of 64
kB on the size of any segment, including the data segment, of your
program. You can get around this by using dynamic data structures like
linked lists or binary trees, which are allocated on the Heap, rather
than in the data segment. There are two conditions to meet: Each record
of your data structure must be smaller then 64 kB, and all the data
must share the 640 kB DOS memory area with your program and DOS (and
the TP IDE, if you are running your program in there). Two ways around
this limitation: Use protected mode compilers (Borland Pascal, Delphi,
Gnu-Pascal...) or store the data in a kind of data base on the disk and
keep only an index in memory.


Mon, 29 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. BDE.dbiCreateInMemTable - Record Size Too Large for Table Error

2. Getting drive sizes larger than 2 gigs...

3. Static data size/data segment to large

4. How Large is your database size?

5. Large disk size

6. How do I increase array size without stack overflow error

7. Increasing array size

8. large array..

9. large arrays of globals

10. passing variable sized arrays to a proc/func

11. Large array supports.

12. Large array

 

 
Powered by phpBB® Forum Software