IniFileWrite
Previous  Top  Next

Prototype

IniFileWrite (FileName, strSection, strKey, strValue)

Description

It sets a parameter of a section to a determined value inside a ini file.

Parameters

FileName: string that rappresents an ini file.

StrSection
: string that represents the section of ini file to read.

StrKey
: string that represents the parameter inside the section you need read.

StrValue
: value to be given to the parameter.

Returned value

None.

Notes

None.

Example

//Stores the name of the current user
UserName:=_JobUser;

// Stores string length JobUser
LengNome:=Length(UserName);

//Stores date and hour.
DateHour:=Now;

//Converts in string the date and the hour.
DateHourStr:=FormatDateTime('DD/MM/YYYY HH:NN:SS',DateHour);

//Unites the username and the date/hour in an sole string (UserName)
Insert(DataOraStr,UserName, LungNome+1);

// Writes in the file the string contained in UserName
IniFileWrite('c:\files\file.ini','Utenti','NomeData',UserName);