Mega Search
23.2 Million


Sign Up

Make a donation  
Error E2283 at Compile-Time  
News Group: borland.public.delphi.ide.general

I'm getting the following Error at Compile-Time:

E2283: Too much local Constants. Use shorter Procedures (E2283)

What is the internal Memorylimit of the Compiler for Strings ?

I'm using Fastreport, but without any Database, because I must read Data 
from an old DOS-Program, export it into a Textfile und read it into 
FastReport to generate Reports and PDF-Files.

I'm using the Method GetValue of the Report:

PROCEDURE TReportForm.frxReport1GetValue(CONST VarName: STRING; VAR 
Value: Variant);
BEGIN
   IF CompareText(VarName, '1') = 0 THEN Value := 
MainForm.RegIniFile.ReadString(Datei, '1', '?');
END;

The Problem is that this Procedure has about 10000 Lines. In one Unit 
there are 57 such Reports. There are 5 such Units, so the Program has 
now approx. 1.4 Mio Lines and the EXE-File has approx. 32 MB Size.

Unfortunately I haven't found any other way to read in Data with FastReport.

What else can I do ? Can I extend the MemoryLimit of Delphi 2007 ?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 7-Jan-2008, at 11:41 PM EST
From: Thomas Speck
 
Re: Error E2283 at Compile-Time  
News Group: borland.public.delphi.ide.general
Thomas Speck wrote:
> I'm getting the following Error at Compile-Time:
> 
> E2283: Too much local Constants. Use shorter Procedures (E2283)
> 
> What is the internal Memorylimit of the Compiler for Strings ?
> 
> I'm using Fastreport, but without any Database, because I must read Data 
> from an old DOS-Program, export it into a Textfile und read it into 
> FastReport to generate Reports and PDF-Files.
> 
> I'm using the Method GetValue of the Report:
> 
> PROCEDURE TReportForm.frxReport1GetValue(CONST VarName: STRING; VAR 
> Value: Variant);
> BEGIN
>   IF CompareText(VarName, '1') = 0 THEN Value := 
> MainForm.RegIniFile.ReadString(Datei, '1', '?');
> END;
> 
> The Problem is that this Procedure has about 10000 Lines. In one Unit 
> there are 57 such Reports. There are 5 such Units, so the Program has 
> now approx. 1.4 Mio Lines and the EXE-File has approx. 32 MB Size.

There's nothing you can do to generalize that?

Is it always the case that the second parameter to CompareText is the 
same as the second parameter to ReadString? If so, then you don't really 
need to have any conditional at all. Nor do you need to repeat that same 
line 1000 times. Replace all that with this:

Value := MainForm.RegINIFile.ReadString(Datei, VarName, '?');

> Unfortunately I haven't found any other way to read in Data with 
> FastReport.
> 
> What else can I do ? Can I extend the MemoryLimit of Delphi 2007 ?

Did you try following the advice of the error message? Use shorter 
procedures. (And then call them each in succession from your 
frxReport1GetValue procedure.)

-- 
Rob

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 7-Jan-2008, at 9:41 PM EST
From: Rob Kennedy