Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running out of memory while compiling 1

Status
Not open for further replies.

oildad

Technical User
Apr 21, 2005
6
0
0
US
When compiling my QBasic program I get the message that I have run out of memory. Is there any way one can write a program in QBasic that requires more than 64K memory? I need to use an array of the size A&(56,44,8), plus a lot of other material, but the A& array blows me out of the compiler. Can I somehow increase the size of the program beyond the 64K limit that apparently the compiler is working with? Nowadays, with so much more computing power, it should be possible to work out larger programs than 64K.
Any advice would be appreciated.
Thanks, Oildad
 
Windows can handle arrays larger than 64K, but QuickBASIC can't because it was written for DOS. There are other free console compilers for a variety of BASIC languages that WILL handle larger arrays. For a list of some of them, check out:


Lee
 
There are some ways around the 64k limit (which really is
probably less in acuality).

For programs that do not use large arrays, try making
other programs that just have subs/functions in them with
no main code.

then load them using the load option into the main program.
When you save, a mak file is made that remembers what bas file are included.

How does this help ? Each bas file will be compiled individually then linked to make one program. each has the
64k limit.

There are libraries that allow the use of XMS and EMS memory.

There are also some switches that allow QuickBasic to use
larger arrays. See also $dynamic meta statement.

Hope that helps some
 
Thank you both for this helpful information, especially all the different compilers available now.
Reprogramming is not always easy to do. In this particular case the large array is something that will stay active most of the time during the processing of the programming, because it will be used as a decision maker.
I have been a programmer for many years, CDC 3200, CDC 6600, and then IBM. Later in my work computer programs were bought and used as a tool, and from then on I did not so much programming any more. After my retirement I am trying to pick up it up again as a hobby, and I have to readjust my thinking a bit.
Once again, thanks for all your input.
 
PowerBasic has several windows compilers at a reasonable cost. You would not have the memory problem there.

Their support is the best in the business too. Their forum
is outstanding.

 
I tried Quickbasic 4.5 (Qb4.5) and found out that the program 'works' there. Apparently size is not so much a problem there. However, the statement CALL ABSOLUTE causes the error message "Subprogram not defined". This statement did not cause that problem with the original QuickBasic compiler. The Index of the compiler mentions the statement as a possibility, but apparently it is not present in the library.
Anybody know on how to bypass this problem. The statement comes from a routine used to use the mouse.
 
In QuickBasic 4.x you must load the library containing call absolute and interrupt.

Start the QB editor with QB /L

That should fix the call absolute error message.
Call absolute is not included in the editor as call absolute is in Qbasic.

the L switch is of the form
/L libraryname

Without a libraryname it defaults to QB.QLB (QBX.QLB for PDS). QB.QLB (and the associated QB.LIB) contain Call absolute and Call interrupt and some other related calls.

You may need to include qb.bi in your program for the declarations (or get from qb.bi the declarations and type defs needed).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top