Topic: How To Read setting.ini and copy value to Form

How To use function save or read setting.ini for copy value to edit.text in form
by select
- script
- option
and setting etc

https://s3.postimg.org/h7854h2n7/2017-07-19_15_56_17.png

My Visual Database : I Love You
Easy For Beginner Student For Me

2 (edited by ehwagner 2017-07-19 20:30:51)

Re: How To Read setting.ini and copy value to Form

See attached example.

Post's attachments

Attachment icon SettingsIni To Form.zip 580.95 kb, 162 downloads since 2017-07-19 

Re: How To Read setting.ini and copy value to Form

Thank You ehwagner
Easy Code For Education  Read by sector sector type

procedure Form1_OnShow (Sender: string; Action: string);
var
    ini: TIniFile;
begin
    ini := TIniFile.Create(ExtractFilePath(Application.ExeName)+'settings.ini');
    try
        Form1.Edit1.Text := ini.ReadString('Script', 'Enabled', '');
        Form1.Edit2.Text := ini.ReadString('Options', 'DBMS', '');
        Form1.Edit3.Text := ini.ReadString('MySql', 'host', '');
        Form1.Edit4.Text := ini.ReadString('MySql', 'port', '');
        Form1.Edit5.Text := ini.ReadString('MySql', 'username', '');
        Form1.Edit6.Text := ini.ReadString('MySql', 'database', '');
        Form1.Edit7.Text := ini.ReadString('MySql', 'savepassword', '');
    finally
        ini.Free;
    end;
end;
begin
end.

https://s1.postimg.org/kg113llrz/2017-07-20_07_40_30.png

My Visual Database : I Love You
Easy For Beginner Student For Me