Why can't I compile large prog's in QB4.5? 
Author Message
 Why can't I compile large prog's in QB4.5?

I really need help with something.

Is it at all possible to compile large EXE's in QB4.5 and/or VBDOS 1.0? I
have written a BBS Door that I was trying to compile, but the compiler
keeps running out of memory. Is there anyway to increase the compilers'
memory or is there a coding shortcut to help decrease the amount of
memory used?

Also, how can I increase the amount of environment memory in QB4.5/VBDOS
or how can I decrease the amount of memory usage>

Thanx to anyone who can help! ;)

--
Arthur Kelly
Director, Camelot Conventions

WWW:   New Host, coming soon
Phone: (201)864-6254



Sat, 14 Nov 1998 03:00:00 GMT  
 Why can't I compile large prog's in QB4.5?

Quote:

>>I really need help with something.
>>Is it at all possible to compile large EXE's in QB4.5 and/or VBDOS 1.0? I
>>have written a BBS Door that I was trying to compile, but the compiler
>>keeps running out of memory. Is there anyway to increase the compilers'
>>memory or is there a coding shortcut to help decrease the amount of
>>memory used?
>>Also, how can I increase the amount of environment memory in QB4.5/VBDOS
>>or how can I decrease the amount of memory usage>
>>Thanx to anyone who can help! ;)

Break the source code up into a number of smaller files and link them
through include files, common shared, etc. Also, watch your string usage
(especially DATA statements). If you can upgrade to PDS71, that will be
a big help, too.


My silly homepage - http://www.linknet.net/lphilpot/
Howls of derisive laughter, Bruce...



Mon, 16 Nov 1998 03:00:00 GMT  
 Why can't I compile large prog's in QB4.5?

G'Day All

Quote:


>Subject: Why can't I compile large prog's in QB4.5?
>Date: 28 May 1996 23:23:46 -0400
>I really need help with something.
>Is it at all possible to compile large EXE's in QB4.5 and/or VBDOS 1.0? I
>have written a BBS Door that I was trying to compile, but the compiler
>keeps running out of memory. Is there anyway to increase the compilers'
>memory or is there a coding shortcut to help decrease the amount of
>memory used?

QB4.x and VBDOS have a limit of 64k for a given program. You can get arround
this by splitting your program into several MODULES. Each module must be less
than 64K, but you can string several modules togeter to get a GINORMOUS
program. Chapter 7 of the QB4.5 manual, pages 251-259, give instructions on
how to do this, and there is a module example in the example files. You may
want to move most of your SUBs/FUNCTIONs to a separate module. Further
instructions can be found in Microsoft Knowledge Base.
(http://www.microsoft.com/ in the support section)

The only way to increase the compilers memory is to ensure that there is as
much of the 640K DOS memory as possible. There is no programming short cut
that I am aware, apart from writing tight code.

Quote:
>Also, how can I increase the amount of environment memory in QB4.5/VBDOS
>or how can I decrease the amount of memory usage>

Do you mean ENVIRONMENT memory or how much of the 640k DOS memory QB/VBDOS
takes up. For the former, you will have to add /E:1024  (or whatever) to
your SHELL statement in config.sys (or create one, see your DOS manual). For
the latter, just make sure that there is as much of the 640K DOS memory free
as possible. (VBDOS may be able to make use of extended memory, check your
manual).

Cheers! Ian

---------------------------------------------
Ian Musgrave Ph.D, Prince Henry's Institute of Medical Research
PO Box 5152, Clayton 3168, Australia.
Phone +61 3 550 4286 FAX +61 3 550 6125




Mon, 16 Nov 1998 03:00:00 GMT  
 Why can't I compile large prog's in QB4.5?

Quote:

>I really need help with something.
>Is it at all possible to compile large EXE's in QB4.5 and/or VBDOS 1.0? I
>have written a BBS Door that I was trying to compile, but the compiler
>keeps running out of memory. Is there anyway to increase the compilers'
>memory or is there a coding shortcut to help decrease the amount of
>memory used?
>Also, how can I increase the amount of environment memory in QB4.5/VBDOS
>or how can I decrease the amount of memory usage>
>Thanx to anyone who can help! ;)
>--
>Arthur Kelly
>Director, Camelot Conventions

>WWW:   New Host, coming soon
>Phone: (201)864-6254

Dear Arthur,
        Let me see if I can shed some light on your problems:

        First, QuickBASIC can only handle individual "modules" with a max
length of 64K bytes.  After your program is compiled, take note
of the last two lines from the compiler output.  One says
something like "Total Bytes Used" and the other says "Space
Available".   If the space available is zero (0) or down to  1 -
2K  bytes, then your code is too large for just one module.
Break your code into multiple files (modules) and compile and
link then together.  With this method, I have created programs
that were in excess of 300K bytes in length.

        Your second question regarding environment space has to with the
method that QB sees your environment.  When you start a program,
DOS creates a 'copy' of the environment space.  This is so that
when you exit a program, the environment will be restored to its'
original form.
        To make changes to the environment variables, you need to create
'dummy' variables at the DOS level before you start your program.
Make sure that whatever you set the variable to at the DOS level,
you provide enough space for the modifications you want to make.
For example, if you make a environment variable like:
        TEST=TRUE
Then in your program you want to reassign the value from TRUE to
FALSE, you will get an 'Out Of Memory' error because your only
allocated four bytes to the environment variable TEST and tried
to assign a value containing five bytes.
        Keep in mind that whatever value you assign to your environment
variable to in your program, when going back to DOS, the
environment variable will contain the originally assigned value.
To change the environment variables at the DOS level within a
program , is a bit more complicated.

Hope this helps.   Good luck.
Dr.Jack



Mon, 16 Nov 1998 03:00:00 GMT  
 Why can't I compile large prog's in QB4.5?

Quote:

>I really need help with something.
>Is it at all possible to compile large EXE's in QB4.5 and/or VBDOS 1.0? I
>have written a BBS Door that I was trying to compile, but the compiler
>keeps running out of memory. Is there anyway to increase the compilers'
>memory or is there a coding shortcut to help decrease the amount of
>memory used?
>Also, how can I increase the amount of environment memory in QB4.5/VBDOS
>or how can I decrease the amount of memory usage>
>Thanx to anyone who can help! ;)
>--
>Arthur Kelly
>Director, Camelot Conventions

>WWW:   New Host, coming soon
>Phone: (201)864-6254

There are a couple of things that you can do.  First, you can put the
program into multiple modules and link the seperate OBJ files.  You
also might try compiling with the /S option - it has made the
difference for me.  Finally, I would suggest moving to powerbasic.
You are not bound by most of the limitations and converting code is
not that difficult - There are several programs out there to help you
out. (I converted a 32,000 line project in a matter of 2 weeks.)


Thu, 19 Nov 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Why a compiled executable won't run on client's machine

2. 'Canned' data in VB program

3. help! need prog's compiled

4. Compile error: Fixed or static data can't be larger than 64K

5. Can't compile databse - why

6. Why doesn't this compile: Dim mydb as Database

7. What is 'Binding' in QB4

8. excellent jobs for vb prog'rs/devl'rs

9. excellent jobs for vb prog'rs/devl'rs

10. excellent jobs for vb prog'rs/devl'rs

11. excellent jobs for vb prog'rs/devl'rs

12. excellent jobs for vb prog'rs/devl'rs

 

 
Powered by phpBB® Forum Software