🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #823

Re: Quick Basic (Program memory overflow.)

#823
From: Bruce Forstall
Date: Tue, 23 Jan 1990 02:02
25 lines
1821 bytes
(Sorry for the wide distribution, but mail attempts bounced...)

I have a friend who has an answer for a recent posting:
--Bruce
-------------------------------------------------------------
| >From: trm@moscom.UUCP (Tim McCarthy)
| [bowling program, memory overflow, stack size?, 65K program, help?]
|                                              Thanks, Tim McCarthy 

The problem does not have anything to do with the stack.  What is happening
is that you are overflowing the maximum code size for a segment.

In the interpreter, each SUB/FUNCTION in a program is treated as an
individual unit, thus you are limited to 64K for a single SUB/FUNCTION.
The compiler, however, treats all items in a module as a single unit, thus
the maximum size of a module is 64K.  Thus, it is possible to have a program
that works fine in the interpreter but will not compile because you have
exceeded the maximum module size.

The way to avoid this problem is to break your program into seperate modules.
(If it helps: in QuickBasic terminology, a module is identical to a file.
It took me quite a while to figure out this highly useful fact.)  The easiest
way to do this is in the interpreter:
    - File/Create  to create a new module
    - View/Subs/Move  to move individual subs/functions to the new module
Technical Details
Message-ID: <21338@pasteur.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!ames!pasteur!manzanita.Berkeley.EDU!forstall

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!ames!pasteur!manzanita.Berkeley.EDU!forstall
From: forstall@manzanita.Berkeley.EDU (Bruce Forstall)
Newsgroups: comp.lang.misc
Subject: Re: Quick Basic (Program memory overflow.)
Message-ID: <21338@pasteur.Berkeley.EDU>
Date: 23 Jan 90 02:02:46 GMT
Sender: news@pasteur.Berkeley.EDU
Reply-To: forstall@manzanita.Berkeley.EDU (Bruce Forstall)
Distribution: na
Organization: University of California at Berkeley
Lines: 25