Klik op het logo voor hulp op afstand
  
 
 
 
 
 
 
 




The INIFILE class


The INIFILE class implements an interface to Windows *.INI files.
 
Constructor
CREATE (Sfn)
Returns an instanciated inifile object. Sfn is the name of the INI file to be used
Destructor
FREE ()
Frees the INI file object
Methods
READSTRING (Ssection,Skey,Sdef) : S
ReadString reads a string value from an INI file. Ssection identifies the section in the file that contains the desired key. Skey is the name of the key from which to retrieve the value. Sdef is the string value to return if the:
-section does not exist
-key does not exist
- data value for the key is not assigned
WRITESTRING (Ssection,Skey,S)
WriteString writes a string value S to an INI file.
Ssection identifies the desired section in the file,
Skey is the name of the key.
READINT (Ssection,Skey,Ddef) : Dint
ReadInt reads an integer value from an INI file. Ssection identifies the section in the file that contains the desired key. Skey is the name of the key from which to retrieve the value. Ddef is the value to return if the:
-section does not exist.
-key does not exist.
- data value for the key is not assigned.
WRITEINT (Ssection,Skey,Dint)
WriteInt writes an integer value Dint to an INI file. Ssection identifies the section in the file, Skey is the name of the key.
READBOOL (Ssection,Skey,Ddef) : Dbool
ReadBool reads a boolean value from an INI file. Ssection identifies the section in the file that contains the desired key. Skey is the name of the key from which to retrieve the value. Ddef is the boolean value to return if the:
-section does not exist.
-key does not exist.
- data value for the key is not assigned.
WRITEBOOL (Ssection,Skey,Dbool)
WriteBool writes a boolean value to an INI file.
Ssection identifies the section in the file, Skey is the name of the key.
READDATETIME (Ssection,Skey,Ddef) : Ddatetime
ReadDateTime reads a datetime value from an INI file. Ssection identifies the section in the file that contains the desired key. Skey is the name of the key from which to retrieve the value. Ddef is the datetime value to return if the:
-section does not exist.
-key does not exist.
- data value for the key is not assigned.
WRITEDATETIME (Ssection,Skey,Ddatetime)
WriteDateTime writes a datetime value to an INI file. Ssection identifies the section in the file,
Skey is the name of the key.
READNUM (Ssection,Skey,Ddef) : D
ReadNum reads a numeric value from an INI file. Ssection identifies the section in the file that contains the desired key. Skey is the name of the key from which to retrieve the value. Ddef is the numeric value to return if the:
-section does not exist.
-key does not exist.
- data value for the key is not assigned.
WRITENUM (Ssection,Skey,D)
WriteNum writes a numeric value to an INI file.
Ssection identifies the section in the file, Skey is the name of the key.
SECTIONEXISTS (Ssection) : B
Verifies if the specified Ssection section exists
DELETESECTION (Ssection)
Delete the specified section Ssection from the inifile
KEYEXISTS (Skey) : B
Verifies if the specified Skey key exists
DELETEKEY (Skey)
Delete the specified key Skey from the inifile
UPDATEFILE ()
Make sure changes made to the inifile are flushed
to disk
Properties
FILENAME
Returns the name of the inifile. (read-only)

 

Example:

ini := IniFile.Create("c:\joppswin\jopps.ini");
language := ini.ReadInt("Language","Language",0);
msg := "The default JoPPS language is ";
IF language = 0 THEN msg := msg + "Dutch"
ELSE IF language = 1 THEN msg := msg + "French"
ELSE IF language = 2 THEN msg := msg + "German"
ELSE IF language = 3 THEN msg := msg + "English"
ELSE msg := msg + "undefined !";
ini.Free();
 



 |  History  |
 
 

 
 
 
TECHWIN SOFTWARE
De Regenboog 11
B-2800 Mechelen
T +32(0)15 44 64 64
T +31(0)30 899 32 15 Nederland