I'm working on a Delphi project that includes a number of units. Two of these units, let's call them UnitA and UnitB, each contain an initialization section. My aim is to ensure that the initialization section of UnitB is always called after UnitA's initialization.
I understand that the order of initialization in Delphi is generally influenced by the order of the uses clause in the units. However, I've found that this isn't always as clear or predictable as I would like.
What I'm wondering is whether there's a way to explicitly force or guarantee the order of initialization. For example, is there a practice or strategy I could employ that would reliably enforce that UnitB's initialization occurs after UnitA's?
In particular, if there are specific methods or techniques that help clarify and control the initialization order of units in Delphi, I would be very interested in learning about them.