Subject Re: [IBO] Filter on Calculated field problem??
Author Jason Wharton
I've logged this as an item to look into.

Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "G. Allen Casteran" <allen@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, July 28, 2002 10:39 PM
Subject: [IBO] Filter on Calculated field problem??


> Help!
>
> I have a query with several calculated fields and I want to filter on
them.
>
> The OnCalculatedFields event fires on teh query and the field value is
> calculated.
> Every time I get to the filter, the value of my calculated field is null.
??
>
>
> Following the debugger into the IBO code came across this problem:
>
> procedure TIBODataset.RecordFilter( ARow: TIB_Row; var Accept: boolean );
> var
> SaveState: TDatasetState;
> begin
> SaveState := SetTempState( dsCalcFields );
> try
> Move( ARow.RowBuffer^, TempBuffer^, RecordSize );
> CalculateFields( TempBuffer ); // THIS CALCULATES MY FIELDS
> except
> Application.HandleException( Self );
> end;
> RestoreState( SaveState ); // THIS WIPES OUT MY
CALCULATIONS
> SaveState := SetTempState( dsFilter );
> try
> Accept := true;
> FFilterBuffer := TempBuffer;
> OnFilterRecord( Self, Accept ); // BEFORE THIS Filter can
> examine them. :(
> except
> Application.HandleException( Self );
> end;
> RestoreState( SaveState );
> end;
>
>
> Bug??
>
> Thanks,
>
> Allen