Hi all,
I'm writing a custom dataset that represents a list of bank transactions: [1]
When showing a currency field (the Amount field in the transaction object in the code), I get NaN.
Likewise, I get invalid results from a date field (Bookdate in the transaction object)
AFAIU, I can just store the data the way I want but obviously I'm 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;FTransactionList is the list with the underlying objects. FCurrentRecord is the current record number.
Suggestions welcome.
Thanks,
Reinier
[1] https://bitbucket.org/reiniero/smalltools/src
directory
BankConvert
file
transactiondataset.pas
