IniWritePvt

Writes data to a private INI file.

Syntax:

IniWritePvt (section, keyname, data, filename)

Parameters:

(s) section major heading to write the data to.

(s) keyname name of the data item to write.

(s) data string to write to the INI file.

(s) filename path and file name of the INI file.

Returns:

(i) @TRUE on success; @FALSE on failure.

 

Writes a value in the "filename" .INI file.

Notes: You cannot use this function to add or update any of the "Device=" entries in the [386Enh] section of SYSTEM.INI, because that section contains multiple entries with the same keyword. See BinaryPokeStr for an example on how to modify the device= lines of the SYSTEM.INI file.

FileName

Path information must be specified if the INI file is not in the Windows directory. If there is no path information provided, then the INI file is assumed to be in the Windows directory (as shown by DirWindows(0) ).

Windows Vista/2008 and newer:
This function may require an Administrator level account if dealing with files located in a protected directories: 'Program Files' and 'Windows'.

The OS considers initialization files special and controls the file location unless a path is specified. It is recommended that initialization file access is to either put the file someplace standard users have access to or make sure that only administrators run the program reading from and writing to the file.

To force the INI updates to disk, add an additional IniWritePvt statement as follows:

IniWritePvt("","","",filename)

 

 

Example:


IniWritePvt("Main", "Lang", "French", "MYFILE.INI")
This would create the following entry In MYFILE.INI:
[Main]
Lang=French
See Also:

Binary Operations, BinaryPokeStr, IniDeletePvt, IniItemizePvt, IniReadPvt, IniWrite