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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROGRAM MEMORY OVERFLOW 1

Status
Not open for further replies.

esfahan

Programmer
Feb 6, 2003
4
IR
I could compile the earlier versions of my program using QB7. But ever since I expanded and added some new features to it, I get this "PROGRAM MEMORY OVERFLOW" message. The compiling process stops, apparently at a different place of the code each time, and this message appears.
I have read the FAQ article about using "overlays" for reducing memory requirements to some extent. But I wish to find some other way, coz I intend to enhance my program even further.
Would conversion of the program to Visual BASIC solve the problem?
Any other suggestions?

Thanks in advance,
Esfahan
 
Hi, quebasic2, and thanks for your reply. I however do not know how and where to use the parameter /AH. I typed /AH following the name of the file, and pressed "Make EXE File",
but QBasic regarded it as a path and just stopped.
Before this, I set the main module as usual, since my program consists of two files linked together thru a MAK file.
I'd very much appreciate your helping me get round this problem.
 
Type /AH after qb.exe in the run command. If you are clicking on an icon, right click the icon and select Properties->click on the Program tab->its should be there next to Cmd Line

It should say something like: C:\qb45\QB.EXE
make it say C:\qb45\QB.EXE /AH

This is for Windows XP, someone else will have to explain if if you are using somethign else.
 
You can get all sorts of weird errors when compiling BAS files saved with the "Fast load and save" option. Save all your modules as text and try re-compiling them.
vcn.gif

Bozo: "You're never a loser on the Bozo show, you're just an almost winner."
Kid: "Cram it, clown!"
Bozo: "That's a Bozo no-no."
 
Hello again, and thanks all of you who tried to help me.
I tried everything, saved the modules as text, used the parameter /AH properly, even manipulated the extended and expanded memories in the property box, but got the same program memory-overflow message again and again. I am almost reaching the conclusion that my program has exceeded the limits of QB7 in capacity.
Still, I should appreciate any further suggestions or possibilities. And thanks again.
 
If you have exceeded the limits, then you need to revise you program, or use a library like future lib.
 
Your output code is probably bigger than 64K.
To make a bigger program you must separate it in several modules(provided you are using SUBs and FUNCTIONS...).

-Remove some (related) subs and functions and put them in a second .bas file.
-Copy all the DECLARE lines from your main program to the top of the second file. You dont' really need them all but it will work.
-Convert all your DIM SHARED declarations to COMMON SHARED
and copy them to the top of the second file.
-Also copy all CONST definitions in the main part of your program to the top of the second file.
-Enable Full Menus if you have them disabled
-Load both files in the IDE, one with Open Program and the other one with Load File.
-Then go to Run>Set Main Module and select your main program.

If i'm not forgetting nothing it should run and compile correctly.
Antoni
 
I forgot to say:
-After converting DIM SHAREDs to COMMON SHARED you must write in the main module DIM's (without SHARED) only for your arrays you were dimensioning there because COMMON SHARED works just as a declaration and won't dimension anything... Antoni
 
Hi, Antoni(agual) & quebasic2,
Just wanted to thank you for the assistance. I am just back from a trip, so did not have the chance to apply your suggestions to my program. But I am quite optimistic that they should work. I remember that I had a similar memory overflow problem with this same program about 2 years ago, and could solve it by dividing it into 2 modules. But I had forgotten what I had done. Now, I think I am beginning to recall them, when Antoni mentioned them. Thanks again.

esfahan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top