Im stuck and asking for your help te get a solution for reading my ini file back and placing that in my memo1 form with a button.
This is in my text file:
[Filename]
Work Time=03-10-2018 15:11
Here is some of the code im working with.
var
aWorkTime: string;
procedure TForm1.button2(Sender: TObject):
begin
Memo1.Lines.Clear;
IniFile := TIniFile.Create(GetCurrentDir+'\Filename.ini');
try
aWorkTime := IniFile.ReadString('Filename', 'Work Time', <'none'>);
finally
IniFile.Free;
end;
end
I hope that this is enough information if not please tell me what you are missing from me
GetCurrentDir
probably isn't what you need. That can change, and is not necessarily the directory of your application. – Jerry DodgeMemo1.Lines.LoadFromFile(FullIniFileName);
. – Rudy VelthuisExtractFilePath(Application.ExeName) + 'FileName.ini'
. Do not useGetCurrentDir
. – Rudy Velthuis