Subject | Re: [IBO] never reach EOF |
---|---|
Author | rick_roen |
Post date | 2004-11-24T00:14:59Z |
In this case EOF never becomes true, it just remains at false after
it reaches the end of the rows and gets stuck on the last row.
I want it to return false after the first "Next" call on the last
row. I think this is normal behavior, but I'm am only learning C/S
now in combo with Firebird and IBO.
My problem stemmed from running a report when I was exporting the
rows to an HTML table. It never exited to EOF loop, so I wrote the
code snippet I posted which never exits as well.
Rick
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
it reaches the end of the rows and gets stuck on the last row.
I want it to return false after the first "Next" call on the last
row. I think this is normal behavior, but I'm am only learning C/S
now in combo with Firebird and IBO.
My problem stemmed from running a report when I was exporting the
rows to an HTML table. It never exited to EOF loop, so I wrote the
code snippet I posted which never exits as well.
Rick
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
> What function are you expecting of EOF here?the server
> It's job is to tell you when no more records are available from
> and it will pull records from the server automatically as itwishes to.
>I
> Jason
>
> > -----Original Message-----
> > From: rick_roen [mailto:rick@l...]
> > Sent: Tuesday, November 23, 2004 3:30 PM
> > To: IBObjects@yahoogroups.com
> > Subject: [IBO] never reach EOF
> >
> >
> >
> >
> > I encountered a problem when iterating through a TIB_Query where
> > never reached EOF.
> >
> > I've distilled it down to the following:
> >
> > procedure TFormCustomerMaintenance.Button1Click(Sender: TObject);
> > var
> > Count: word;
> > begin
> > Count := 0;
> > DMCM1.QBillto.First;
> >
> > while not DMCM1.QBillto.BufferEof do begin
> > DMCM1.QBillto.BufferNext;
> > inc( Count );
> > if Count > 500 then
> > Break;
> >
> > end;
> > ShowMessage( inttostr( Count ) );
> >
> > Count := 0;
> > DMCM1.QBillto.First;
> >
> > while not DMCM1.QBillto.Eof do begin
> > DMCM1.QBillto.Next;
> > inc( Count );
> > if Count > 500 then
> > Break;
> >
> > end;
> > ShowMessage( inttostr( Count ) );
> > end;
> >
> > The first count returns correctly with 96 using the BufferEOF.
> >
> > The second count "Breaks" and returns 501.
> >
> > Is EOF not functional in IB_Query?
> >
> > Rick
> >