Ok so I have this procedure that creates series for my chart at runtime, it works fine, the first time. While the program is running I have to at one point when the user clicks an icon, I have to cycle through the series to see which ones of my box items are there and if X is not there create a new series. It doesn't work needless to say the second time, I get an error on run.
This is my procedure:
procedure createSeries ();
for I := 0 to Form1.servlist.Items.Count-1 do
account := Form1.servlist.Items.Strings[I];
autoP := readBoolFromRegistry('Softwaremf' + account, 'wping', false);
if autoP = true then
Line := TLineSeries.Create(Line);
Line.Title := account;
Line.Name := account;
Line.Marks.Visible := true;
Line.Marks.Clip := false;
If Form1.Chart1.SeriesList.IndexOf(Line.Pointer) = -1 then
It all works perfect the first time, but the second time it says that line component already exists.