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

> At 03:44 PM 8/09/2003 +0100, you wrote:
> >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.
>
> Actually, EOF and BOF are states. It goes blank because there is *no* row
> there. Both BOF and EOF are true when there is nothing at all in the
buffer.
>

I dont object to that, I just believe that Next and Prior should not go into
space at each end, they should stay on the last record. In effect you
agree with me ;-) because thats exactly what the code on the NavBar does.

>
> Hang your button actions off an invisible NavBar. ..snip 8<

Helen - that's a horrible solution! I thought at least you would suggest I
keep my own derivitive of TIB_Query with my own Next and Prior methods ;-)

> That way, your EOFs and BOFs behave perfectly and Jason writes your code.
> :-))

I seem to remember raising this a looong time ago and Jason admitted it was
a problem but needed Next and Prior to go off the end for internal reasons -
he suggested I look at the source of the nav bar and copy the way it is done
there.

My point is that the code in there is too messy for frequent use (compared
to 'next') in an application and that it is not a good developer interface.
This is one of those few occasions where the BDE was designed better. I
would like to see a solution to it and believe it would be an improvement to
IBO.

Regards
Paul