Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program memory overflow
#1
Dear Sirs,
I use qbasic (7.1) for programing industrial control systems run on 486 computers. At a certain (how long) size I get the error message program memory overflow while compiling.
The same program does execute in interpreter mode but I can not make exe from it. Is there any way out?

Best Regards
Abdollah Sadjadian
Reply
#2
means that you have to break your program up into separate modules (files), compile each .BAS file separately (with BC.EXE) and then link them together (with LINK.EXE). If PDS is like QB (and I think it is in this regard), you do that from within the IDE by using Load (under the File menu) to load each module in and then use the usual IDE option to make the executable. (I just never use the IDE method. So, if you want to use that method, you may want to get help from someone who has.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#3
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
Reply
#4
were defining arrays, he still needs the DIM statement (in addition to the COMMON SHARED statement). He just doesn't need the SHARED attribute in it. COMMON statements don't dimenionalize arrays. They just store their addresses.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#5
Also:
- TYPES must be re-declared in the second module if some variable there uses them.
-DATA read by subs/functions in the module must be moved to it..

Now you can be sure at 99% it will work.... Big Grin
Antoni
Reply
#6
.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)