I use this code to create a .ini file in the project folder:

uses IniFiles var Form1: TForm1; Ini: TIniFile; procedure TForm1.FormCreate(Sender: TObject); begin Ini := TIniFile.Create(ExtractFilePath(ParamStr(0))+'config.ini'); Ini.Free; end; 

but nothing is created at startup. What's the matter ?

  • one
    and if there is a little something to write? - KoVadim
  • @KoVadim what to add? - Varg Sieg
  • write any values ​​inside the file. - KoVadim

1 answer 1

From the point of view of the program, an empty ini file and the missing one are equivalent. Therefore, there is no data - it makes no sense to save.