Page 1 of 1

Large arrays

Posted: Tue Sep 04, 2007 3:48 am
by nyfiken
Does anyone know how to use arrays bigger than (180,180) in Qbasic or Quickbasic?

Is it possible to use arrays of size (300,300) wich is 90Kb, or even better, (300,300,300) wich is 27 Mb?

It seems one must use dynamic arrays, some switches in the command line, and some sort of EMS but I dont understand how to put it together.

Edit: Looks like dim(xx,xx) always produce a static array.
________
Mike parkes

Posted: Tue Sep 04, 2007 6:02 am
by Mentat
Save to .DAT, write to a smaller array, and when you need to, write over it.

Posted: Tue Sep 04, 2007 6:50 am
by nyfiken
Made a quick test, seems it will take to much time, I?ll take a look at VB for Win to se if I can solve it there instead. Thanks anyway. :)
________
X

Re: Large arrays

Posted: Tue Sep 04, 2007 10:03 am
by sid6.7
nyfiken wrote:Does anyone know how to use arrays bigger than (180,180) in Qbasic or Quickbasic?

Is it possible to use arrays of size (300,300) wich is 90Kb, or even better, (300,300,300) wich is 27 Mb?

It seems one must use dynamic arrays, some switches in the command line, and some sort of EMS but I dont understand how to put it together.

Edit: Looks like dim(xx,xx) always produce a static array.
the biggest i could get to work was 125,125....so i made mine
about 120,80...when i tried 900,900(a map) it locked up...

Posted: Tue Sep 04, 2007 12:21 pm
by nyfiken
the biggest i could get to work was 125,125....so i made mine
about 120,80...when i tried 900,900(a map) it locked up...


Seems like max is 180,180 with integer (2 byte) and 127,127 with long or single (4 byte), a 64k limit.

So 300,300 integer it should be 300*300*2=180 kb.

After rewiewing my code I see I only need approx 500*5, very sloppy programming.

QB will be used some more... (but it was interesting to look at VBW)
________
Yamaha dragstar history

Good work

Posted: Tue Sep 04, 2007 2:07 pm
by Mac
nyfiken wrote:
After reviewing my code, I see I only need approx 500*5
Good man!! Nearly every time someone needs more space or a faster computer, etc., it turns out that they really need to code better.

In 1961, I managed a team that wrote an operating system for the Joint Chief's Command Center at the Pentagon. We required 4K of memory. That's right, 4K. the other 12K were reserved for application programs.

And it was a pretty snappy system, giving the generals multi-colored displays of war data and options to invoke troup actions. On a 1401 computer.

Now, I save a data file consisting of one byte and it appears to take more than 4K. LOL and shame on the programmers of today.

I'm glad you saw the light!

Mac