Navigation: Language Reference > 13 - Built-in Functions >====== PUTINI (set INI file entry) ====== | |
PUTINI( section [,entry] [,value] [,file] )
PUTINI | Sets the value for an INI file entry. |
section | A string constant or variable containing the name of the portion of the INI file which contains the entry. |
entry | A string constant or variable containing the name of the specific entry to set. If this parameter is omitted, the entire section, including all entries within the section, is deleted. |
value | A string constant or variable containing the setting to place in the entry (up to 1023 characters). An empty string ('') leaves the entry empty. If omitted, the entry is deleted. |
file | A string constant or variable containing the name of the INI file to search. A file name without a full path (e.g. 'Autolog.ini') looks for the file in the Windows directory. To look for the file in the current directory enter a dot path (e.g. '.\Autolog.ini'). If the file doesn't exist, a new .INI file is created. If omitted, PUTINI places the entry in the WIN.INI file. |
The PUTINI procedure places the value into an entry in a Windows-standard .INI file (maximum size of the file is 64K). A Windows-standard .INI file is an ASCII text file with the following format:
[some section name]
entry=value
next entry=another value
For example, WIN.INI contains entries such as:
[windows]
spooler=yes
load=nwpopup.exe
[intl]
sLanguage=enu
sCountry=United States
iCountry=1
The PUTINI procedure searches the specified file for the entry within the section you specify. It replaces the current entry value with the value you specify. If necessary, the section and entry are created.
Example:
CODE
PUTINI('MyApp','SomeSetting','Initialized') !Place setting in WIN.INI
PUTINI('MyApp','ASetting','2','MYAPP.INI') !Place setting in MYAPP.INI
See Also: