Subject | Re: [IBO] never reach EOF |
---|---|
Author | rick_roen |
Post date | 2004-11-24T00:17:22Z |
In this case EOF never returns "True", it just keeps looping.
I put in the "Break" after 500 just to stop the process.
I'm expecting that after the last row, the "Next" will cause a EOF
to become true and the loop will naturally exit, but it doesn't.
Where am I mistaken?
Rick
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
I put in the "Break" after 500 just to stop the process.
I'm expecting that after the last row, the "Next" will cause a EOF
to become true and the loop will naturally exit, but it doesn't.
Where am I mistaken?
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
> >