Page 1 of 1

Ver 8.05 gives exception error in debug mode

Posted: Thu Jun 04, 2009 2:38 pm
by 10550737
Hi,

I just upgraded to ver 8.05 and get the following exception error during debug mode in Delphi 2009:

"Exception class ElistError 'List index out of bounds(-1)' in
procedure TChartSeries.DrawAllValues;

I get this error when using:
Series1.AddXY( 123, 456, 'Hello', clGreen );

But this one gives no exception:
Series1.AddXY( 123, 456, 'Hello');

Note that both lines works in release mode.

Thanks,

Thomas

Posted: Thu Jun 04, 2009 2:54 pm
by narcis
Hi Thomas,

I'm not able to reproduce the problem here. Can you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Fri Jun 05, 2009 7:20 am
by 10550737
Hi NarcĂ­s,

I just uploaded the files in "addxy_exception_debug.zip" on your upload page.

The project is just a new Tchart on a form with two buttons:

procedure TForm1.Button1Click(Sender: TObject);
begin
Series1.AddXY( 123, 456, 'Hello'); //works
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Series1.AddXY( 123, 456, 'Hello', clGreen ); //does not work
end;

The last button gives the error in debug mode for
procedure TChartSeries.DrawAllValues;

Thanks,
Thomas

Posted: Fri Jun 05, 2009 9:26 am
by yeray
Hi Thomas,

It's strange, we've tested your project in two different machines and couldn't reproduce the problem. Shall we do any specific step we may missed?
We executed you app ensuring that we do it in debug mode and that there the reference to the sources.

Posted: Sun Jun 07, 2009 9:47 am
by 10550737
Hi again,

I have a rather fast new PC (Intel core 2 quad at 2.4 GHz, Nvidia GT8600). Could it be some speed issue making it non-reproducable for you?

In "Series.pas":
(procedure TCustomSeries.DrawValue(ValueIndex:Integer);)

I get the error on line 2181:
//TV52013890
if {$IFDEF CLR}(ValueIndex>0) and{$ENDIF}(IsNull(ValueIndex-1)) then if null }

If this line is change to this there is no error:
if (ValueIndex>0) and (IsNull(ValueIndex-1)) then { if null } //ok

Thanks,
Thomas

Posted: Mon Jun 08, 2009 8:29 am
by yeray
Hi Thomas,

Here we've tested with our new machines too that are pretty similar than yours (Intel core 2 quad at 2.4 GHz, Nvidia GT8500, 3.25 GB RAM) so it shouldn't be due to a hardware difference.

TV52013890 was a VCL for NET bug and that's the reason of the "IFDEF CLR".

Re: Ver 8.05 gives exception error in debug mode

Posted: Fri Jun 12, 2009 9:25 am
by 10550418
Try testing with range check on. I think that i got the same bug and fixed/worked around it by changing the following function in teEnging.pas testing on a negative value used to look in an array.

{ Returns True is the ValueIndex point in the Series is Null. }
Function TChartSeries.IsNull(ValueIndex:Integer):Boolean;
begin
if ValueIndex < 0 then
Result := True
else
result:=ValueColor[ValueIndex]=clNone;
end;

Hope this helps.

Re: Ver 8.05 gives exception error in debug mode

Posted: Tue Jun 16, 2009 8:00 am
by yeray
Hi Thomas and Ronald,

We now could reproduce the problem. It seems that the bug solved for Delphi for NET (TV52013890) is also reproducible for Delphi when Range Checking is on. So we want you to know that we have changed the Series.pas as Thomas suggested the 7th of June:

Code: Select all

if (ValueIndex>0) and(IsNull(ValueIndex-1)) then { if null }
if FTreatNulls=tnDontPaint then
begin
  OldX:=X;
  OldY:=Y;
end;

Re: Ver 8.05 gives exception error in debug mode

Posted: Tue Jun 16, 2009 10:19 am
by 10550737
Yeray and Ronald,

Thanks for your help!