Главная страница | назад





Article #16002: Data segment too large error.

 Question and Answer Database
FAQ1002D.txt Data segment too large error.
Category :Compiler
Platform :All
Product :All 32 bit
Question:
When I add a large number of typed constants to my application,
my data segment grows too large. How can I get around this?
Answer:
Typed constants are added to the Program's data segment. Untyped
constants are added to the code segment of the application only if
they are used. Unless you are going to reassign the value of a typed
constant, you should use an untyped constant instead. Typed constants
should be replaced with initialized variables to be compatible with
future versions of the compiler.
Example:
{This adds the constant to the data segment}
const SomeTypedString : string = 'Test';
const SomeTypedInt : integer = 5;
{This adds the constant to the code segment if used}
const SomeUnTypedString = 'Test';
const SomeUnTypedInt = 5;
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99