Qbasicnews.com
November 28, 2021, 12:12:51 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: program memory overflow  (Read 5509 times)
A.Sadjadian
New Member

Posts: 18


« on: February 13, 2003, 02:33:24 AM »

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
Logged
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #1 on: February 13, 2003, 03:10:17 AM »

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.)
Logged

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.
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #2 on: February 13, 2003, 03:55:08 AM »

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.
Logged

Antoni
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #3 on: February 13, 2003, 12:22:54 PM »

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.
Logged

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.
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #4 on: February 14, 2003, 07:39:31 PM »

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.... Cheesy
Logged

Antoni
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #5 on: February 15, 2003, 12:30:46 AM »

.
Logged

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!