Try this. Start a new project, and drop a TStringGrid and a TiniPropStorage component on the form. Add OnCreate and OnClose handlers for the form, and complete them thus:
unit IniPSmain;
{$mode objfpc}{$H+}
interface
uses
Forms, Grids, IniPropStorage;
type
{ TForm1 }
TForm1 = class(TForm)
ps: TIniPropStorage;
sgrid: TStringGrid;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
implementation
uses sysutils;
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
ForceDirectories(GetAppConfigDir(False));
ps.IniFileName:=GetAppConfigFile(False, False);
ps.Active:=True;
ps.IniSection:= 'sgrid.Font';
sgrid.Font.Size:=17;
end;
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
ps.StoredValue['sgrid.Font.Size']:= IntToStr(sgrid.Font.Size);
CloseAction:=caFree;
end;
end.
Compile and run the project. Close the main form. Then look for a YourProjectName.cfg file in the appropriate directory for your OS.