Difference between revisions of "TIniFile.Rename"
(new page) |
Savage0795 (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 9: | Line 9: | ||
==Example== | ==Example== | ||
− | |||
<syntaxhighlight lang="pascal"> | <syntaxhighlight lang="pascal"> | ||
Line 26: | Line 25: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | [[Category: | + | [[Category:TIniFile]] |
Latest revision as of 20:36, 16 June 2018
procedure Rename(const AFileName: string; Reload: Boolean) AFileName: new file path Reload: if TRUE, TIniFile will be reloaded from a new location
Description
This procedure changes the file assigned to TIniFile
Note that it doesn't create/save file to new location,
so if you set Reload to TRUE, make sure the new file exists.
Example
var
ini: TIniFile;
begin
// assuming Sandbox Level < 2
ini := File.CreateINI('example.ini');
ini.Rename('deleteMe.ini',FALSE); // kas.ini still doesn't exists
ini.UpdateFile; // it's being created here
ini.Free;
end.