|
WriteINI() 
Writes a value to an INI (configuration)
file.
Syntax
WriteINI(<cSection>, <cEntry>,
<xValue>, [<cINIFile>]) -> lSuccess
Arguments
<cSection> --> The section name of the
INI file.
<cEntry> --> The entry within the INI
file.
<xValue> --> The value to write to the
INI file. You may pass character, number, logical and date values
to this function. Values are always written to the INI file as
character strings.
<cINIFile> --> The INI file to write to.
If not specified, the system default INI file is written to
(typically CAPWIN.INI or the file specified by the /CONFIG=
parameter when the application is started).
Returns
TRUE if the write operation was successful,
otherwise FALSE.
Description
This function allows you to write an entry value
to the specified section of an INI file. This is useful when you
wish to have the system remember a setting or value between running
sessions of the application software.
If the INI file you specify does not exist, it
will automatically be created, otherwise the value you specify will
replace the existing value if it already exists. If you do not
specify a file path as part of the .INI file name, the .INI file is
written to the Windows folder or the profile folder of the user
(depending on the operating system's configuration settings).
Example #1
* Write the INI
file Capital_CBS.INI in the Windows
* folder or user
profile folder
If
WriteINI("MySection", "File", "Test Value",
"Capital_CBS")
Echo("Success")
Endif
Example #2
* Write the INI
file called MyINIFile to the CAPITAL
* program
folder.
If
WriteINI("Section1", "Value", 123, PathProgram() +
"MyINIFile")
Echo("Success")
Endif
____________________________
Related Topics
Business
Function List
ReadINI()
|