Hi, im trying to read the values of subitems[6] in a listview, if the value is empty how do i ignore reading it and just go the next subitem[6] that does contain a value??!
here is what i have so far, its to populate a teechart based on the value of the listview, im working with these values for test purposes, but it only reads the first 2 rows and stops after the last value:
procedure TfrmMain.UpdateWeightSeries;
var
i,j: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with WeightSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the fitness table and:
-> get the value entered in all weight boxes
-> add to the fitness chart the number of weeks based on if weight has a value}
for i:= 0 to lvwFitnessTable.Items.Count do
begin
if lvwFitnessTable.Items.SubItems[6] <> '' then
begin
{add weight values to stringlist}
aStringList.Add(lvwFitnessTable.Items.SubItems[6]);
ShowMessage(lvwFitnessTable.Items.SubItems[6]); //doesnt read past 15.9 - it should skip the gap and read 15.8
{add to the chart, we can now count actual weeks via aStringList.Count}
Add(StrToFloat(lvwFitnessTable.Items.SubItems[6]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
finally
aStringList.Free;
end;
end;
here is what i have so far, its to populate a teechart based on the value of the listview, im working with these values for test purposes, but it only reads the first 2 rows and stops after the last value:
procedure TfrmMain.UpdateWeightSeries;
var
i,j: Integer;
aStringList: TStringList;
begin
try
aStringList:= TStringList.Create;
with WeightSeries do
begin
Clear; //clear previous entries otherwise it will keep adding
{loop through each entry in the fitness table and:
-> get the value entered in all weight boxes
-> add to the fitness chart the number of weeks based on if weight has a value}
for i:= 0 to lvwFitnessTable.Items.Count do
begin
if lvwFitnessTable.Items.SubItems[6] <> '' then
begin
{add weight values to stringlist}
aStringList.Add(lvwFitnessTable.Items.SubItems[6]);
ShowMessage(lvwFitnessTable.Items.SubItems[6]); //doesnt read past 15.9 - it should skip the gap and read 15.8
{add to the chart, we can now count actual weeks via aStringList.Count}
Add(StrToFloat(lvwFitnessTable.Items.SubItems[6]), IntToStr(aStringList.Count), clNone);
end;
end;
end;
finally
aStringList.Free;
end;
end;