Link to home
Start Free TrialLog in
Avatar of janozzy
janozzy

asked on

Ini_file

Hi all
I need to write a small progman.
program read and write to ini-file.
And i want to keep inifile in program homedirectory

this code works but Is there any other way to locate file?

pelaajatiedot:=Tinifile.Create('c:\homedir\PackAliases.ini');

Thanks
Janozzy
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of janozzy
janozzy

ASKER

ou jes

Thanks
glad to helped you ;-)
I find it very handy to use ChangeFileExt() like so:

var
  IFile: TIniFile;
begin
  try
  IFile := TIniFile.Create(ChangeFileExt(paramstr(0),'.ini'));
  //do stuff
  finally
  FreeAndNil(IFile);
  end;
end;

reddarin =)