🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.ansi-iso
Article #27

Re: ## HELP ## with Turbo Pascal 7.0 (Compiler Error 49)

#27
From: Ron Muzzi
Date: Wed, 19 Jun 1996 00:00
43 lines
2745 bytes
will-cib@digital.net (Doug Williams) wrote:

>During compile, I am getting error 49 Data Segment to large.
>In my Uses section of my program I have the following:
>
>
>
>Uses dos,crt,support,menubox,objects;
>
>The latter 3 are my tpu's.
>
>
>
>In help, it says to create a pointer to objects to lower the 
>data segment or something.  If anyone understands how to 
>correct this problem or my spelling I would sure appreceate it.
>
>Doug 
>

There are a few things you can do:

First, go through your variables (because these get stored in the data segment) 
and make sure that you are not wasting space.  For example, "string" uses 
256 bytes of space.  It's better to use "string[n]" where n is the actual
max size of your string.  You will also want to define some types of these
shorter strings to be used in procedure/function calls.

Second, use the heap for variable space.  Read in your manual how to use the 
heap.  It involves using GetMem, New, Dispose, etc.  A pointer is used to access
variables created on the heap.  (That's what the error explanation is referencing.)
The pointer will be in the data segment, but the heap uses all other available 
memory.  Therefore, it is good for records, strings, arrays, etc.  The other 
advantage of the heap is that you allocate memory for your variables during 
runtime and you can deallocate the space when you are done with it.

Let us know if you have any other questions.

Ron Muzzi, EE
Great Lakes Environmental Research Lab
Ann Arbor, Michigan, USA
muzzi@glerl.noaa.gov
Technical Details
Message-ID: <4q94po$fdb@hovis.rdc.noaa.gov>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4q7enr$6t7@ddi2.digital.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f6aa,705188ec19b8262f
X-Google-Attributes: gid10f6aa,public
X-Google-Thread: 10261c,705188ec19b8262f
X-Google-Attributes: gid10261c,public
X-Google-Thread: 111659,705188ec19b8262f
X-Google-Attributes: gid111659,public
X-Google-Thread: 10c950,705188ec19b8262f
X-Google-Attributes: gid10c950,public
X-Google-Thread: 102bfa,705188ec19b8262f
X-Google-Attributes: gid102bfa,public
X-Google-Thread: 102601,705188ec19b8262f
X-Google-Attributes: gid102601,public
X-Google-Thread: 10d4ef,705188ec19b8262f
X-Google-Attributes: gid10d4ef,public
From: Ron Muzzi <muzzi@glerl.noaa.gov>
Subject: Re: ## HELP ## with Turbo Pascal 7.0 (Compiler Error 49)
Date: 1996/06/19
Message-ID: <4q94po$fdb@hovis.rdc.noaa.gov>
X-Deja-AN: 161022974
references: <4q7enr$6t7@ddi2.digital.net>
content-type: text/plain; charset=us-ascii
organization: NOAA HDQ Resource Develompent Center
mime-version: 1.0
newsgroups: comp.lang.pascal.ansi-iso,alt.msdos.programmer,comp.lang.pascal.borland,comp.lang.pascal.misc,comp.os.msdos.programmer,comp.programmer,ctdl.lang.pascal
x-mailer: Mozilla 1.1N (Windows; I; 16bit)