TmemTable has not onCalcFields event? lazarus / 16-Databases ---------------------------------------------------------------------- dpap · 2025-02-02 20:19 I want to use a TMemTable for temporary record storing but, as I saw, doesn't exist a onCalcFields. Is there a similar memTable (or can I add) this event? ---------------------------------------------------------------------- Zvoni · 2025-02-03 07:49 Quote from: dpap on February 02, 2025, 09:19:30 pmI want to use a TMemTable for temporary record storing but, as I saw, doesn't exist a onCalcFields. Is there a similar memTable (or can I add) this event? There is no TMemTable. Do you mean TMemDataset? And why would you expect an OnCalcFields-Event? https://wiki.freepascal.org/TMemDataset (Yes, i know: Wiki is not Documentation, but i was too lazy to search further) QuoteA TMemDataset descendant acts like a cursor on a table or query- result.There are no calculated fields in a QUERY-RESULT ---------------------------------------------------------------------- dpap · 2025-02-03 09:17 Yes, I mean TmemDataset. I want to have some fields in the table that act as lookup fields, and due to TmemDataset's lack of ability to have lookup fields, I plan to calculate them in the onCalcFields event using the locate method. Yes, I know I can write a function that calculates these values ​​when needed, but I would prefer the onCalcFields event. ---------------------------------------------------------------------- wp · 2025-02-03 09:44 Maybe you should try TBufDataset. It is a memory table, too, but is more complete. ---------------------------------------------------------------------- dpap · 2025-02-04 07:38 I know this but TBufDataset needs a file to write/read and this is not convenient for me ---------------------------------------------------------------------- Thaddy · 2025-02-04 08:33 Quote from: dpap on February 04, 2025, 08:38:50 amI know this but TBufDataset needs a file to write/read and this is not convenient for me To my knowledge that is not true. Just call Buffdataset.CreateDataset; // I tested that just now!! It does not need a filename. And the use of Tmemtable is discouraged anyway. The code should be marked as deprecated. ---------------------------------------------------------------------- egsuh · 2025-02-09 07:46 TMemDataSet does not, but TBufDataSet has OnCalcFields event handler. So, you should use TBufDataSet. You do not need a file for it. ---------------------------------------------------------------------- Richard Marriott · 2025-07-05 23:57 Try this note on how to set up calculated fields using OnCalcFileds: https://tdataset7.wordpress.com/how-to-use-tmemdataset-in-code-and-ide