Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#3

AW: Counting in a database table

  Alt 30. Nov 2012, 10:19
Column names are not known in advance.
Now counts correctly.
y := 0;
y1 := 0;
for I := Table.FieldDefs.Count -1 downto 2 do
begin
if Pos('1', Table.FieldByName(Table.FieldDefs[i].Name).AsString) > 0 then
begin
y := y + 1;
Label1.Caption := IntToStr(y) + ' x';
Application.ProcessMessages;
end;
if Pos('10', Table.FieldByName(Table.FieldDefs[i].Name).AsString) > 0 then
begin
y1 := y1 + 1;
Label2.Caption := IntToStr(y1) + ' x';
Application.ProcessMessages;
end;
end;
Daniel
  Mit Zitat antworten Zitat