I have a TwebClientDataSet and I want to iterate over the rows and refresh data using the TwebClientConnection (conNaehrwerte) via a REST API.
This is the code:
cdsZutaten.First;
while not cdsZutaten.eof do begin
sLcd := cdsZutaten.FieldByName('lebensmittelcd').AsString;
sHcd := cdsZutaten.FieldByName('herkunftcd').AsString;
set_conNaehrwerte(sLcd, sHcd);
cdsZutaten.Next;
end;
procedure set_conNaehrwerte(const aLcd, aHcd: string);
begin
conNaehrwerte.Active := False;
conNaehrwerte.URI := ...'';
conNaehrwerte.AfterConnect := add_Nutrients;
conNaehrwerte.Active := True;
end;
The add_nutrients is called only once after the last row has been fetched. How do I force this to be executed in sync?
TIA Bernd