-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_IniFiles.pas
More file actions
43 lines (33 loc) · 725 Bytes
/
_IniFiles.pas
File metadata and controls
43 lines (33 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
unit _IniFiles;
interface
uses
SysUtils, Forms, IniFiles;
type
TMyIni = class
private
public
Constructor Create;
Destructor Free;
function Read(Section,Ident:String; Default:String=''):String;
procedure Write(Section,Ident,Value:String);
end;
implementation
var
vIni: TIniFile;
constructor TMyIni.Create;
begin
vIni:= TIniFile.Create(ExtractFilePath(Application.ExeName)+'\config.ini');
end;
destructor TMyIni.Free;
begin
vIni.Free;
end;
function TMyIni.Read(Section,Ident:String; Default:String=''):String;
begin
Result:= vIni.ReadString(Section, Ident, Default);
end;
procedure TMyIni.Write(Section,Ident,Value:String);
begin
vIni.WriteString(Section, Ident, Value);
end;
end.