'Initialization' sections are executed in poorly predictable order, so I
want to partially order them according to some form of explicit
prioritization and execute before control flow enters main block (so I
won't need to run all that initialization by hand, neither I would be
able to forget to do that). Like:
unit UnitA;
...
procedure Init;
initialization
RegisterUnit('UnitA', @Init);
end;
unit UnitB;
...
procedure Init;
initialization
RegisterUnit('UnitB', @Init, {priority} +1);
end;
...
procedure SortAndInitialize;
...
Can I run SortAndInitialize before 'main' without additional user actions?
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal