first it might be better to use Integer-Fields thean String Fields, to avoid double counting.
second all Fields inthe Table should be defined and knowed, so you better use a
Query like
Delphi-Quellcode:
for I := Table.FieldDefs.Count -1 downto 2 do
begin
case Table.FieldByName(Table.FieldDefs[i].Name).AsInteger of
1 : begin
cnt1:= cnt1 + 1;
Label1.Caption := IntToStr(cnt1) + ' x';
Application.ProcessMessages;
end;
10 : begin
cnt10 := cnt10 + 1;
Label2.Caption := IntToStr(cnt10) + ' x';
Application.ProcessMessages;
end;
K-H
Thank you, now it counts quickly and correctly.
I somehow forgot the Case: