Monday, February 23, 2026

Trump

There is a huge discrepancy in the way that USA President Trump is regarded in his own country and how he is regarded in Israel.

For many Israelis, he is extremely popular1, albeit unpredictable, although that unpredictability may help his popularity. He is the man who managed to return the last of the Israeli hostages after the 7 October massacre; he also put an end to that war. He is the man who many Israelis believe is about to start another war with Iran and possibly even bring an end to the reign of the Ayatollas. That Iran will attack Israel should USA (and possibly Israel) attack Iran is seen as collateral damage.

Every time I see Trump on Israeli news, I ask my wife whether the average American in the street is even slightly interested in what Trump is doing in foreign lands. The partial answer was shown on tv the other night: his US popularity has declined to about 40% (may be lower) which is very low for an incumbent president.

As Professor Michael Covington (who I follow for computing reasons) writes, I think February 20, 2026, may be remembered as the end of the Trump era in American politics — it may have broken Trump's spell in a way that the election of Biden did not. That is the day the Supreme Court overturned Trump's capriciously imposed tariffs. He is trying to reinstate the tariffs by other legal mechanisms, but that's not the important part.

Trump single handedly cost many Israelis a great deal of money when he began a trade war last year: the S&P 500 share benchmark funds dropped in value overnight and have not regained the momentum that they had before. I had no small amount of money linked to the S&P 500 (retirement funds) and although I switched them to Israeli share funds (that had a phenomenal yield last year), there was some loss. Not everyone was adept as I (and there are probably more people adept than me in this field) and so some probably suffered.

Internal links
[1] 2018



This day in blog history:

Blog #Date TitleTags
15923/02/2009DietCooking, Food science, Diet, Jeff Duntemann
67823/02/2014Carole Bayer Sager - tooCarole Bayer Sager
67923/02/2014DCI Banks on televisionTV series, DCI Banks, Police procedurals
137823/02/2021My room (waiting for wonderland) - a little musical analysisVan der Graaf Generator, Music theory

Saturday, February 21, 2026

Migrating a query form to D12CE

I reckon that yesterday1's serendipitous discovery about the data controls saved about ten hours' work and who knows how much frustration. With not having to worry about data controls, I was able to dive straight in to the migration process. To use a metaphor, migrating an application is like hill climbing; one has to put in a great deal of work to cover maybe 80% of what needs to be done, but once that 80% is done, the rest is relatively easy.

After having obtained what I thought was a stable framework with nothing extra defined, I wanted to migrate a simple query form first: this form displays the number of times each unit has been accessed by which user during a given time period. This form uses the regular (for me) paradigm2 of a page control with two tabs, one in which the user chooses values for parameters and one in which the relevant data is displayed. This form also allows the query parameters to be saved for recall at a later date.

As such, even though I'm theoretically migrating one unit (Manage38, to be precise), I also have to migrate a unit that handles the saved parameters (Manage137) and add the various necessary queries to the data module. Adding the necessary queries is mechanical work, copying the name, sql statement and parameters from the old dbExpress based queries to the new FireDAC queries. There is one very important caveat with this: if the query is saving a Hebrew string (like the name of a person or an activity or whatever), the parameter datatype must be defined as ftWideString; this ensures that the string will be saved in Unicode Hebrew.

I don't think that Manage137 presented any challenges, but Manage38 certainly did. Apart from replacing queries, I also had to reconnect an OnCalcFields handler to one of the queries. The major problem with this unit was the handling of indexes for displaying the data, should the user wish to change by which field the data is sorted, and whether it is sorted in reverse. I had devoted some time to this issue previously3, but there the solution was very specific, using real field names, whereas I wanted something much more generic - the index handling routine will probably be used by 50-100 units! 

As I wrote then,[w]ith 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. So instead of defining the indexes at the beginning each unit's code and simply changing them when the user clicks on the grid's header, I needed to create an index after that header click.

This actually required two separate library calls, although one is a subset of the other. The subset call is required when the form is initially displayed so that it can be sorted by the same field as it was the last time the form was opened. The more interesting library call is in the OnTitleClick handler - 'n' is the column number, and 'rev' adds an extra definition should the data be required to be sorted in reverse order.

Procedure ChangeIndex (rev: boolean; column: integer; aquery: TFDQuery); var s, aname: string; idx: TFDIndex; begin s:= aquery.fields[column].FieldName; aname:= 'idx_' + s; idx:= aquery.Indexes.FindIndex (aname); if idx <> nil then aquery.indexes.delete (idx.Index); idx:= aquery.Indexes.Add; idx.name:= aname; idx.fields:= s; if rev then idx.descfields:= s else idx.descfields:= ''; idx.active:= true; aquery.IndexName:= aname; aquery.First; end;

Now that I have this unit defined, I'll start migrating other query forms. It's good that I read my old blogs, because yesterday I had forgotten the corollary to that statement predefined indexes get deleted every time data is copied to the table, namely [this is] a real bug that has been fixed. I'm using a newer version of Delphi and FireDAC, and CoPilot assures me that my original procedure ('BuildIndexes') will work now as it worked then. So I'll restore that code into the current unit and see whether it does indeed work. Assuming that it does, that will save another mechanical translation to watch out for.

What is going to be time consuming is that some 'father' forms have only one 'son' form but one in particular has 20-30 son forms! I'll leave that one for later.

Internal links
[1] 2078
[2] 1400
[3] 2066



This day in blog history:

Blog #Date TitleTags
2521/02/2006Virus ate my bagelsProgramming, Computer virus
81321/02/2015Musicology and harmonyMusic theory