Tuesday, February 03, 2026

69 and a half years old

Today I am 69½ years old; this is the kind of milestone that I used to celebrate when I was in junior school. Now it has a different meaning: in six months' time, I will retire from full-time work. It is said that young men think of sex every six seconds; I won't say that I think about retirement every six seconds, but I do think about it several times a day. 

Ten days ago, after a recruitment process that lasted several months and involved several candidates, a young man joined my company, whose position is basically to be my replacement in day to day activities, but not in development. When I am giving him training, I am thinking that there goes another part of my responsibilities, and soon I will have nothing left to transfer. This is why I frequently think of retirement.

But there is another reason to mark this day. Way back in July last year, I wrote1 As I needed to have my eyes tested (my eyesight has improved somewhat and I reckon that I no longer need to wear glasses when driving), I stopped at the optometrist who is next door to the butcher. He tested my eyes and found that indeed my long distance sight has improved - apparently I have the beginning of a cataract. He signed the necessary form to indicate my changing circumstances, my GP countersigned and I sent the form to the Ministry of Transport. Shortly afterwards, I received by post a temporary driving license that relieves me of the need to wear glasses when driving; the license was valid until 03/02/26 - today. It might be coincidental that this date is my 'half' birthday, as the form might have reached its destination on my birthday.

Since then, I've been waiting for a permanent license to arrive. Eventually I got in touch with the ministry on 15 December; I was told that I needed to have a new photograph taken to be inserted into the license (I could have been told this much earlier). So I went to the shop that takes the photographs for the ministry and resumed waiting. I was told that the new license would arrive in 30 days. 

On 22 January, more than 30 days later, I contacted the ministry again and was told that the license has indeed been issued and that it is in the post. I commented that the postal services are bad in Israel and that they should find a better way of delivering - I wouldn't have minded going to the ministry's office in Bet Shemesh and picking up the license there. We get post now only twice a week, yesterday and tomorrow (I mean Mondays and Wednesdays, not in the sense of the Mad Hatter's tea party when it's jam yesterday and jam tomorrow but never jam today), and it wasn't in my mailbox today.

So effectively from today I cannot legally drive any vehicle.

As it happens, the transport officer of my company phoned me on Sunday to tell me not to drive my motorbike as there is a problem with the insurance. I told him that I hadn't been driving it recently anyway, due to the cold and rain; I didn't think of it at the time that my license was about to become invalid. 

Internal links
[1]  1964



This day in blog history:

Blog #Date TitleTags
54503/02/2013The twins came to visit yesterdayUncle
67203/02/2014Philip Seymour HoffmanFilms, Obituary
80203/02/2015End of an eraPersonal
92403/02/2016Problems with bloggingMeta-blogging
171503/02/2024Once again a new songSong writing

Thursday, January 29, 2026

Getting used to FireDAC components

In my last post1, I wrote that I adopted the FireDAC components [that] work very well in a test harness. Maybe in a simple test, the use of only a TFDQuery is sufficient to query a database and forward data to a grid for display, but in a real program, this component on its own was lacking.

In the main form of the first program that I am converting, I need the following

  • The grid should open with data displayed properly (obviously) - the unicode problem.
  • Editing a record in a separate dialog box should cause the record in the grid to refresh - but only the one record. There is no need to refresh all the data.
  • Clicking on the title bar should cause the grid to be sorted according to the column that was clicked.
  • A second click on the same column should cause the grid to be sorted in reverse order (i.e. if before it was in ascending order, then now it should be sorted in descending order).
  • After changing the sort, the 'current record pointer' should always be at the beginning of the grid.
  • Exiting the program should not cause an error.

Most of the above seems simple to program, but I ran into many "gotchas", some due to FireDAC and some due to the Delphi version (10.2 Seattle). According to CoPilot, many of the bugs that I encountered have been fixed in more recent versions, but I have to learn how to work around them.

As well as consulting CoPilot, I also read the book "Working with FireDAC" by Cary Jensen that I found online a few days ago . I learnt a great deal about ClientDataSets from earlier work of Jensen's, but I haven't learnt too much from this later book. In Chapter 5, he recommends connecting a FDCommand component to a FDTableAdapter that is connected to a FDMemTable that is connected to a datasource component that is connected to the grid (this arrangement is approximately the same with dbExpress components). One enters the SQL command in the FDCommand, opens the FDMemTable and as a result, data is displayed in the grid.

I thought that everything would be fine from now on, but the FDMemTable is not a ClientDataSet and my usage was causing many problems. After a great deal of trial and error, my requirements were met mainly by copying the data from one FDMemTable to another MemTable that is not connected to the FDTableAdapter but is connected to the datasource and grid. In this configuration, the MemTable that is connected to the grid is a local connection, and so deleting data from it (in order to refresh an edited record) does not delete data from the database. 

There is a problem with persistent fields and indexes in this copied MemTable; I suspect that the structure of the copied table came from when the table was connected directly to the Command/TableAdapter duo, before it was disconnected from them. This may prove to be a problem in the future, although not insurmountable. With a ClientDataSet I could define indexes on the query when a form opens and these indexes would always be available; with FDMemTable, predefined indexes get deleted every time data is copied to the table (a real bug that has been fixed), so I have to use a more dynamic method. Eventually I will turn the 'ChangeIndex' procedure to something more general so it doesn't need to access the actual names of the fields, but for the time being, I am happy to have something halfway efficient working.

Now that the main form of the program is working, the secondary forms shouldn't present too much of a problem - at least, not from the FireDAC point of view. They will have other problems, I am sure, and entering new data into the program from a file is going to be interesting because of unicode issues. 

Internal links
[1] 2065



This day in blog history:

Blog #Date TitleTags
15729/01/2009The Goodbye GirlFilms
44629/01/2012Disappointment - Finance exam resultsMBA, Finance
44729/01/2012Watching the weight / 4Food science, Diet
110829/01/2018Noise cancelling headphones (2)MP3, Headphones
128829/01/2020XML files in PriorityPriority tips
171229/01/2024TEMU is the new Ali ExpressGuitars, Pedal board, Temu