Subject Re: [ib-support] Looping logic is "loopy"
Author Nando Dessena
Dale,

> Here's a Delphi example to show what I'm talking about...
>
> tblSource.Active := TRUE;
> tblIBDest.Active := TRUE;
>
> while not tblSource.Eof do begin
> tblIBDest.Append;
>
> if not (tblIBDest.State in dsEditModes) then tblIBDest.Edit;
> {do something here - add field values for example to new record}
>
> tblSource.Next;
> end;
>
> tblIBDest.Post;
>
> If I walk thru this logic using the debugger, I notice that each
> record reaches the "Append" statement and is processed. When I
> examine the resulting table, however, the last record is missing
> (even though I saw it being appended using the debugger).

you should balance your Append calls with Post calls. Otherwise you are
taking advantage (?) of some kind of autopost facility.

> Any ideas as to what I am doing wrong?

Put tblIBDest.Post inside the loop.
HTH
--
____
_/\/ando