Subject Re: [IBO] TIB_Column.Value for Currency DataTypes
Author Helen Borrie
At 08:17 PM 12/09/2004 +0200, you wrote:
>With the new FasrReport3 Engine I got a problem with TIB_Column.Value,
>if IsCurrencyDataType is true.
>It will return a Variant of type String.
>
>I try a workaround to get the value as Variant of type Currency and it
>seems to work (Delphi 5).
>
>What was / is the problem with varType = Currency?

TIB_Column itself doesn't have the varType property - it's a read-only
property of a variant, so you would have to create a variable of type
Variant and cast it using the VarAsType() function. But you don't need
this workaround.

The Value method is there for BDE compatibility and isn't of much use for
anything in IBO except when playing with ARRAY types. If you set the
Currency attribute in the fields editor, IBO (and the FR native IBO driver)
will then treat it as a currency type for output purposes. "Under the
hood", it retains the data type that corresponds to its SQLType and so is
available for calculations.

When referring to it in code, use the appropriate casting method, in this
case AsCurrency. This ensures that it gets treated as a number and also
gets the proper mask and alignment when it appears in controls and reports.

Helen