Subject Re: [IBO] Bof and Eof Problem
Author Jason Wharton
Here's how most people's loops look.

with my query do begin

Open;
while not Eof do begin
...
Next;
end;
end;

What would happen if once the record hit the last row if it also reported
Eof = true?

From what I can tell, you would not process the last row because the loop
would be exited.

I think the behavior of Bof and Eof should be the same.

You need to change your logic to probe for Eof and Bof and avoid it
accordingly.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Chris Hulsey" <chulsey@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, March 26, 2001 1:43 PM
Subject: [IBO] Bof and Eof Problem


> Hello All,
>
> I am in the process of converting over to IBO from the BDE. I replaced a
TTable with the TIB_Query. I load the TIB_Query with a SQL string like
"SELECT * FROM TICKET_INFORMATION ORDER BY ACTIVE_DATE DESCENDING". It
fetches the records but the Bof and Eof don't seem to work properly. The
don't seem to realize that I am on the first or last record until I go past
them.
>
>
> void __fastcall TForm_TripleWindow::Button_ScrollPreviousClick(
> TObject *Sender)
> {
> if (!Query_TicketInformation->Bof)
> {
> Query_TicketInformation->Prior();
> PopulateTicketCaption();
> PopulateTicketDetail();
> }
> }
>
> void __fastcall TForm_TripleWindow::Button_ScrollNextClick(TObject
*Sender)
> {
> if (!Query_TicketInformation->Eof)
> {
> Query_TicketInformation->Next();
> PopulateTicketCaption();
> PopulateTicketDetail();
> }
> }
>
> Chris Hulsey
> chulsey@...