In our previous episode, Reinier Olislagers said:
> missing something.
> 
> The relevant code:
> function TTransactionDataset.GetFieldData(Field: TField; Buffer:
> Pointer): boolean;
> ...
>   Result := true;
>   case Field.FieldName of
>     'HashID': StrPLCopy(Buffer, FTransactionList[FCurrentRecord].HashID,
> Field.Size);
>     'BookDate': TDateTime(Buffer^) :=
> FTransactionList[FCurrentRecord].BookDate;
>     'Amount': Currency(Buffer^) := FTransactionList[FCurrentRecord].Amount;

In surprise that it compiles. If buffer is an (untyped) pointer, buffer^ is
a byte afaik (just sizeof() it).  You cast that byte to currency and then
use it as lvalue? 

Maybe I miss some weird FPC ability there, and the currency cast makes it
take more bytes, but I would expect

pcurrency(buffer)^:=

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to