Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

data segment too large message?

1 view
Skip to first unread message

TomCorcora

unread,
Aug 23, 1996, 3:00:00 AM8/23/96
to

Hi,

Agte my project (delphi 1.0 on win95) finishes compiling I get a message
"data segment too large". Does this mean I have too many constants (I have
a good amount of array of constants, is this a bad idea?)?

Any ideas?

Thanks.

Tom.

Michael H. Sherrane

unread,
Aug 24, 1996, 3:00:00 AM8/24/96
to

tomco...@aol.com (TomCorcora) wrote:

>Hi,

>Any ideas?

>Thanks.

>Tom.

You have this problem with 16-bit apps. Because of the segmented
architure of 16-bit OS, a segement has a maximum of 64K. Delphi v1
produces 16-bit applications. You OS (Win95, Win NT, or Win 3.1)
doesn't matter, because you are designing your system to run on 16-bit
machines. Also, Delphi will allow you to use only one data segment.

Constants are put into the data segment. Also simple variables will
also require more data storage. If you were to replace your array of
constants with TStringList variables, your app would compile and run.

Also, evaluate your data storage. A String variable allocates 256
bytes in Delphi v1. If the string will not contain more then 30
characters, declare it as String[30]. Also use objects and pointers
wherever you can.

Hope this helps.

Mike Sherrane
sher...@bluemtn.com blue mountain software

Our motto: "Work hard,have fun,make money."
(Delphi,Progress,C++, & Rad. Atlanta, Georgia. 770- 875-8324)
www.bluemtn.com


Boris Ingram

unread,
Aug 25, 1996, 3:00:00 AM8/25/96
to

In article <4vleb6$c...@newsbf02.news.aol.com> tomco...@aol.com (TomCorcora) writes:
>From: tomco...@aol.com (TomCorcora)
>Subject: data segment too large message?
>Date: 23 Aug 1996 19:20:06 -0400

>Hi,

>Agte my project (delphi 1.0 on win95) finishes compiling I get a message
>"data segment too large". Does this mean I have too many constants (I have
>a good amount of array of constants, is this a bad idea?)?

>Any ideas?

Yes, too many constanrts. Thought of using .res files ?

HTH

Boris Ingram, Cyborg Software
bori...@iafrica.com
10007...@compuserve.com
http://www.pcb.co.za/users/borising/cyborg.htm

Alf Christophersen

unread,
Aug 26, 1996, 3:00:00 AM8/26/96
to

In article <4vlj0p$11...@mule1.mindspring.com>, sher...@atl.mindspring.com
says...

>
>Constants are put into the data segment. Also simple variables will
>also require more data storage. If you were to replace your array of
>constants with TStringList variables, your app would compile and run.
>
>Also, evaluate your data storage. A String variable allocates 256
>bytes in Delphi v1. If the string will not contain more then 30
>characters, declare it as String[30]. Also use objects and pointers
>wherever you can.

It is also a good idea to wrap all variables in a unit into one object and
store this on the heap. Then you may minimize the datasegment use of
variables and you can use it for other things.

--------------------------------------------------------------------
Alf Christophersen, Computer engineer
Nordic School of Nutrition,
PO Box 1046, Blindern, N-0316 Oslo Norway
Tel. +47 22 85 13 27, Fax: 22 85 15 32
Roo...@mail.e-world.com list owner
Editor of 'Slekt og Data', Quarterly organ of DIS-Norge,
PO Box 146, Manglerud N-0612 Oslo
URL: http://www.uio.no/~achristo
soc.genealogy.nordic, no.slekt and no.slekt.programmer proponent


0 new messages