Subject Re: [IBO] TIB_Column->AsDouble gives weird results
Author Jason Wharton
Nothing, use the one that works and not the one that doesn't. See the
Contact sample application to see how you should be doing it even more
explicitly.

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


----- Original Message -----
From: "Mario Zimmermann" <mail@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, April 03, 2001 11:50 PM
Subject: [IBO] TIB_Column->AsDouble gives weird results


> Hello IBOler,
>
> I want to display a customer's cashflow in a IB_Grid where negative
> values should be displayed in red color. Here is what I've tried (C++
> syntax):
>
> in IB_Grid::GetCellProps() :
>
> if ( ARow == 0 )
> return;
>
> CashFlowQuery->BufferRowNum = IB_Grid->DataRow[ARow];
> TIB_Column* column = IB_Grid->GridFields[IB_Grid->DataCol[ACol]];
>
> if ( column->FieldName == "CREDIT" )
> {
> if ( column->AsDouble < 0 )
> AFont->Color = clRed;
> else
> AFont->Color = clBlack;
> }
>
> This gives weird results. But when I change the line
>
> if ( column->AsDouble < 0 ) to
> if ( CashFlowQuery->BufferFieldByName ("CREDIT")->AsDouble < 0 )
>
> everything works as expected.
>
> What am I doing wrong ?
>
> Many thanks in advance.
> Mario