---
title: Ini files
description: "You may clone all examples from git at this repository: https://github.com/SigmaEstimates/AppScript-Examples.git Learn how you can store App data in the end users roaming data profile. This enables you to create specific settings for your App, based on user interaction and configuration.…"
url: "https://developer.sigmaestimates.com/docs/ini-files/"
updated: "2019-05-07"
category: Sample Code
---

# Ini files

You may clone all examples from git at this repository: https://github.com/SigmaEstimates/AppScript-Examples.git
Learn how you can store App data in the end users roaming data profile. This enables you to create specific settings for your App, based on user interaction and configuration.
uses
  System.IO.Inifiles;

const
  //Inifile will be stored in %APPDATA%CodeGroupSigma Install Folder Namemyinifile.ini
  sInifileName = &#x27;%sigma_currentuser%myinifile.ini&#x27;;

var Username: string;

procedure LoadSettings;
begin
  var IniFile := TMemoryIniFile.Create;
  try
    IniFile.LoadFromFile(sInifileName);
    Username := IniFile.ReadString(&#x27;Userinfo&#x27;, &#x27;Username&#x27;, &#x27;&#x27;);
  finally
    IniFile.Free;
  end;
end;

procedure SaveSettings(Username: string);
begin
  var IniFile := TMemoryIniFile.Create;
  try
    IniFile.LoadFromFile(sInifileName);

    IniFile.WriteString(&#x27;Userinfo&#x27;, &#x27;Username&#x27;, Username);
    IniFile.SaveToFile(sInifileName);
  finally
    IniFile.Free;
  end;
end;

Username := &#x27;TheUserName&#x27;;
SaveSettings(Username);
Username := &#x27;&#x27;;
LoadSettings();

showmessage(Username) ;

View this file on GitHub
