Subject | TIB_Column->AsDouble gives weird results |
---|---|
Author | Mario Zimmermann |
Post date | 2001-04-04T06:50:40Z |
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
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