Subject Problem in IsEmpty method
Author Luiz Alves

I think there is a small problem with 'isempty' in tib_query.

query: select * from clientes

Ordering Items:

Ordering Links:

1. I open a query with OrderingItemNo=0.

2. I order by Pront field in asc order(OrderingItemNo=1) and go to end of
dataset(with last button of a navigator)

3. Now, if I test for 'query.isempty' it returns TRUE, although the
dataset is not empty.

4. If I go to first record of the dataset(with first button of a navigator),
the problem goes away.

I am trying track the problem and it seems to be in 'ValidateRows( 1, 1 )'
called from function: TIB_BDataset.GetIsEmpty: boolean;

There are many comparations between variables in this function and I don't
achieve fix it.

I think that problem is related to sign of BufferRowNum. In IBO 4,
BufferRowNum can assume values positives and negatives and the comparations
in the function mentioned above are not works as due.

I had similar problems on event OnGetCellProps from Tib_Grid due negative
sign of BufferRowNum and I used another approach to do it work, as next code
below, to paint alternate rows in different colors:

if ((abs(BufferRowNum) >= 0) and (AColor <> clHighlightText))then begin
if (abs(ARow) mod 2)=0 then
else AColor:=clGreen