Subject Re: [IBO] EOF BOF craziness
Author Paul Hope
Hi Daniel

Just place a TIB_Query, TIB_Dataset and TIB_Text on a form and link them up.
Also 2 buttons (for next and prior).
In the form OnCreate open the query. Under the first button put Query.Prior
and the second put Query.Next.

Using the Next/Prior will give the 'at end/beginning of dataset' error.

then under the buttons put

if not eof then next and if not bof then prior.

You will notice that the IB_Text goes blank when each end is reached -
because the current row (one past the end) is invalid.

I need it to stop on the last/first valid record because in reality I am
doing a lot more.

Regards
Paul

> Hi,
>
> At September 8, 2003, 10:13, Paul Hope wrote:
> > It seems crazy to me that I cant have a button calling
> > TIB_Query.Next and not get an 'At end of dataset' error when it gets
> > to the end.
>
> > I cant even do 'if not eof then next' because eof isnt true until after
the next is processed.
>
> [...snip code...]
>
> > When calling Prior, bof similarly doesnt work as I expect - I have to
use (RowNum=0)
>
> > Any suggestions of a more straight forward approach?
>
> Can you show the code that you are having problems with? Can you
> explain what you are trying to do? And, which IBO components are you
> using, native or TDataset descendants? I use EOF and BOF all the time
> without any problems.
>