Syntax
|
WriteIni
section$,ItemName$,value$[,filename$]
|
Description
|
Writes a new value into an .ini file.
|
Comments
|
The
WriteIni
statement requires the following parameters:
|
|
Parameter
|
Description
|
|
section$
|
String specifying the section that contains the desired variables, such as "windows." Section names are specified without the enclosing brackets.
|
|
ItemName$
|
String specifying which item from within the given section you want to change. If ItemName$ is a zero-length string (""), then the entire section specified by section$ is deleted.
|
|
value$
|
String specifying the new value for the given item. If value$ is a zero-length string (""), then the item specified by ItemName$ is deleted from the ini file.
|
|
filename$
|
String specifying the name of the ini file.
|
Example
|
This example sets the txt extension to be associated with Notepad.
Sub Main()
WriteIni "Extensions","txt","c:\windows\notepad.exe ^.txt","win.ini"
End Sub
|
See Also
|
ReadIni$ (function); ReadIniSection (statement)
|
Note
|
If filename$ is not specified, the win.ini file is used.
If the filename$ parameter does not include a path, then this statement looks for ini files in the Windows directory.
|