3
I have a while not Eof
normal in a Clientdataset.
The only detail is in Afterscroll, where I edit the dataset in question and I give a post in the same. When the Eof is True, after the post he changes to False. Debugging the situation, I realized that internally the Clientdataset calls the routine Resync, which in turn, calls the routine Activatebuffers, and this finally changes the control FEOF for False. At this point, I continue on the last record of my Clientdataset, but he understands that he is not in Eof.
How can I fix it? It’s a bug delphi?
Code:
Cds.First;
While not Cds.Eof do
begin
Sleep(10);//Exemplo
Cds.Next;
end;
Afterscroll
Cds.Edit;
Cds.FieldByName('QTDE').AsFloat := 10;
Cds.Post;
In Afterscroll, when it is EOF, after the Post the EOF returns to False.
If it is positioned on the last record then it is not EOF.
– Reginaldo Rigo
@Reginaldorigo You’re right, I expressed myself wrong (sorry). But after the Cds.Next, gets into the Afterscroll and at that moment it is already as EOF, the problem is that after the post on the CDS, the EOF is amended to False.
– Andrey
Andrey, put your code :)
– David
From what you have said, it repositions the pointer on the last record and this confuses the logic you used in your flow. I think you need to change this flow or this logic.
– Reginaldo Rigo
Guys, I found out with the help of @Reginaldorigo. It really was logic problem. Because it was already EOF, there was no record selected, when it was given Edit/Post, it returned to the last valid record, but the EOF actually stopped being True. Thank you.
– Andrey