List Index out of bounds...TChartTools

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bdw
Advanced
Posts: 132
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

List Index out of bounds...TChartTools

Post by bdw » Tue Aug 19, 2025 11:52 pm

I seem to be getting the following error popup from time to time, I've not narrowed it down to when as there are lots of factors.

List index out of bounds (18). TChartTools range is 0..17

I've not been able to trigger this error reliably yet.

I suspect it could be due to a group of TPointSeries graphs that have an associated TMarksTipTool assigned to them for hint popup.

It could be a thread creation timing issue. Is there a way to stop this error popping up ?

bdw
Advanced
Posts: 132
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: List Index out of bounds...TChartTools

Post by bdw » Tue Aug 19, 2025 11:54 pm

Forgot to say this is with TChart v2025.43 and BDS 12.3 Update 3

Yeray
Site Admin
Site Admin
Posts: 9728
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: List Index out of bounds...TChartTools

Post by Yeray » Wed Aug 20, 2025 7:17 am

Hello,

Difficult to say without the code.
I guess you may be accessing the list of tools with an out of range index. To prevent that, you can add an if condition before accessing it. Ie:

Code: Select all

var toolIndex: Integer;
begin
  toolIndex:=myIndex;

  if toolIndex >= Chart1.Tools.Count then Exit;

  // Now it should be safe to get the tool at the toolIndex
  Chart1.Tools[toolIndex]...
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply