|INI files management|
|By: John A. Nyhart Date: 18/07/1997|
This great function will manage INI files and do all the API work for you! With a single function you'll be able to write or read settings from multi-section INI files!
|ReadWriteINI(inifile, mode, section, key, [value])|
|inifile: name and path of the INI file to manage
mode: may be WRITE or GET
section: name of the INI file section
key: name of the setting to write or get
value: default value for GET mode, value to write for WRITE mode (optional)
Type of data
|OK for a successfull WRITE.
The read value for a successfull GET.
Example: to get the setting maxentries from the [Recent Files] section and store it max variable, we'll use this code:
|max = ReadWriteINI("MyApp.Ini","Recent Files","maxexntries",4)|
If the key does not exits, a default value of 4 will be
To write the same information to the ini file, we'll type:
The function and its API declarations are contained in a module. You can cut and paste them in any program of yours.
|Visual Basic Programming Zone is a website by
Lorenzo Dalla Vecchia.
Webmaster's e-mail: firstname.lastname@example.org
Hosted by InWind: www.inwind.it