Subject | Fix for BCD numerics in Lazarus/FreePascal support |
---|---|
Author | IBO Support List |
Post date | 2014-05-15T12:17:06Z |
Note to all:
There was also a fix needed for BCD numerics in IBO's Lazarus/FreePascal
support.
Here is a patch for it:
{$IFnDEF IBO_SUPP_FIELDDATA_IS_TVALUEBUFFER}
procedure TIBOBCDField.SetAsBCD( const Value: TBcd );
{$IFDEF FPC}
var
tmpCur: Currency;
{$ENDIF}
begin
{$IFDEF FPC}
BCDToCurr( Value, tmpCur );
SetData( @tmpCur );
{$ELSE}
SetData( @Value );
{$ENDIF}
end;
function TIBOBCDField.GetAsBCD: TBcd;
{$IFDEF FPC}
var
tmpCur: Currency;
{$ENDIF}
begin
{$IFDEF FPC}
if ( GetData( @tmpCur )) then
Result := CurrToBCD( tmpCur )
else
Result := NullBCD;
{$ELSE}
if ( not GetData( @Result )) then
Result := NullBCD;
{$ENDIF}
end;
{$ENDIF}
Thanks,
Jason Wharton
www.ibobjects.com
There was also a fix needed for BCD numerics in IBO's Lazarus/FreePascal
support.
Here is a patch for it:
{$IFnDEF IBO_SUPP_FIELDDATA_IS_TVALUEBUFFER}
procedure TIBOBCDField.SetAsBCD( const Value: TBcd );
{$IFDEF FPC}
var
tmpCur: Currency;
{$ENDIF}
begin
{$IFDEF FPC}
BCDToCurr( Value, tmpCur );
SetData( @tmpCur );
{$ELSE}
SetData( @Value );
{$ENDIF}
end;
function TIBOBCDField.GetAsBCD: TBcd;
{$IFDEF FPC}
var
tmpCur: Currency;
{$ENDIF}
begin
{$IFDEF FPC}
if ( GetData( @tmpCur )) then
Result := CurrToBCD( tmpCur )
else
Result := NullBCD;
{$ELSE}
if ( not GetData( @Result )) then
Result := NullBCD;
{$ENDIF}
end;
{$ENDIF}
Thanks,
Jason Wharton
www.ibobjects.com