Please enable JavaScript to view this site.

Codolex

Navigation: Activities > IniFile

IniFile Read

Scroll Prev Top Next More

The IniFile Read activity can be used to get data from a local ini file into a variable.

uses System.IniFiles.TIniFile

 

IniFileRead

Activity properties

 

var IniFile := TIniFile.Create(IniFilePath);

try

   keys.APIKey1 := IniFile.ReadString('keys', 'APIKey1', '123');

   keys.APIKey2 := IniFile.ReadString('keys', 'APIKey2', '');

finally

   IniFile.Free;

end;

Resulting code

 

The activity expects a path to the ini file, and variable to store the values in.

 

It's recommended to create an inifile datasource to get the variable to store the ini values in.

More information about the datasource: IniFile Datasource

© by GDK Software