Giuliano Colla wrote:

However, what I've learned from this episode is that while attempting to save configuration data using TINIFile on program termination you should never use a try..finally construct, as it's suggested everywhere, but rather a try..except (or both). Otherwise you'll never be able to catch possible errors.

I'd suggest that there are two separate cases here. In the first case, near the start of a program you decide whether there is a preexisting .ini file, create it if not, and if necessary update it to contain e.g. the default name of a backend server. In the second case, at the the end of a program run you save the current session's state.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to