Difference between revisions of "TIniFile.WriteDate"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
m
 
Line 5: Line 5:
  
 
==Description==
 
==Description==
This procedure updates an existing key's value or creates a new one.
+
This procedure updates an existing key's value or creates a new one.<br>
 +
Note that key value will be in ''YYYY-MM-DD'' format.
  
 
==Example==
 
==Example==

Latest revision as of 02:04, 23 August 2013

procedure WriteDate(const Section, Ident: String; Value: TDateTime)
 Section: Section name
 Ident: Property name (key)
 Value: Value to be assigned to a key

Description

This procedure updates an existing key's value or creates a new one.
Note that key value will be in YYYY-MM-DD format.

Example

Example adds a new (useless) key to soldat.ini

const
  // assuming Sandbox Level < 2
  PATH = 'soldat.ini';

var
  Ini: TIniFile;

begin
  Ini := File.CreateINI(PATH);
  Ini.WriteDate('BOTS','CurrDate',Date());
  Ini.UpdateFile;
  Ini.Free;
end.