[fpc-pascal] Re: Fpc Access Violation if AppConfigDir doesn't exist.

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Mon Feb 11 12:40:44 CET 2013


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]



More information about the fpc-pascal mailing list