Large arrays

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
nyfiken
Newbie
Posts: 7
Joined: Sun Aug 26, 2007 11:57 pm

Large arrays

Post 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
Last edited by nyfiken on Tue Feb 15, 2011 10:32 pm, edited 1 time in total.
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

Save to .DAT, write to a smaller array, and when you need to, write over it.
For any grievances posted above, I blame whoever is in charge . . .
nyfiken
Newbie
Posts: 7
Joined: Sun Aug 26, 2007 11:57 pm

Post 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
Last edited by nyfiken on Tue Feb 15, 2011 10:32 pm, edited 1 time in total.
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Re: Large arrays

Post 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...
nyfiken
Newbie
Posts: 7
Joined: Sun Aug 26, 2007 11:57 pm

Post 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
Last edited by nyfiken on Tue Feb 15, 2011 10:32 pm, edited 1 time in total.
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Good work

Post 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
Post Reply