Friday, May 19, 2006

simple elegant way to read ini files (Delphi)

I still see people do weird things to load settings from an .ini file; I always use this method

uses
IniFiles;
...

with TIniFile.Create(Application.ExeName) do
try
//load the settings here
finally
Free
end


nice, short, clean and simple

my thing is whenever I find something simpler or nicer than the way I do things, I change to that new way and stick to that, I think that's a simple principle to keep on becoming better developer

No comments: