Klik op het logo voor hulp op afstand
  
 
 
 
 
 
 
 




The REGISTRY class


The REGISTRY class implements an interface to the Windows registry.

The windows registry is a system database that an applications can use to store and retrieve configuration information. It replaces the older *.INI configuration files used in Windows 3.x applications.  

Configuration information is stored in a hierarchical tree. Each node in the tree is called a key. Every key can contain subkeys and data values that represent part of the configuration information for an application.

All keys that an application creates, opens, reads, or writes are subkeys of predefined root keys. By default, a REGISTRY object is created with a root key of HKEY_CURRENT_USER.

The REGISTRY class methods and properties are implemented to resemble their INIFILE counterparts where possible.

 

Constructor

CREATE (Skey)

Returns an instanciated registry object

Destructor

FREE ()

Frees the registry object

Methods

READSTRING (Skey,Sident,Sdef) : S

ReadString returns a string value from a specified data value associated with a key.

Skey is a string that identifies the key from which to retrieve a data value. Sident is a string that identifies the name of the data value to return. Sdef is a string value to use if there is no key corresponding to Skey or no data value corresponding to Sident.

WRITESTRING (Skey,Sident,S)

WriteString stores a string value in a data value associated with a specified key.

Skey identifies the key into which to store a data value. Sident identifies the name of the data value into which to write. S is the value to write into the data value.

READINT (Skey,Sident,Ddef) : Dint

ReadInt returns an integer value from a specified data value associated with a key.

Skey is a string that identifies the key from which to retrieve a data value. Sident is a string that identifies the name of the data value to return. Ddef is a numeric value to use if there is no key corresponding to Skey or no data value corresponding to Sident.

WRITEINT (Skey,Sident,Dint)

WriteInt stores an integer value in a data value associated with a specified key.

Skey identifies the key into which to store a data value. Sident identifies the name of the data value into which to write. Dint is the value to write into the data value

READBOOL (Skey,Sident,Ddef) : Dbool

ReadBool returns a boolean value from a specified data value associated with a key.

Skey is a string that identifies the key from which to retrieve a data value. Sident is a string that identifies the name of the data value to return. Ddef is a boolean value to use if there is no key corresponding to Skey or no data value corresponding to Sident.

WRITEBOOL (Skey,Sident,Dbool)

WriteBool stores a boolean value in a data value associated with a specified key.

Skey identifies the key into which to store a data value. Sident identifies the name of the data value into which to write. Dbool the value to write into the data value

READDATETIME (Skey,Sident,Ddef) : Ddatetime

ReadDateTime returns a datetime value from a specified data value associated with a key.

Skey is a string that identifies the key from which to retrieve a data value. Sident is a string that identifies the name of the data value to return. Ddef is a datetime value to use if there is no key corresponding to Skey or no data value corresponding to Sident.

WRITEDATETIME (Skey,Sident,Ddatetime)

WriteDateTime stores a datetime value in a data value associated with a specified key.

Skey identifies the key into which to store a data value. Sident identifies the name of the data value into which to write. Ddatetime is the value to write into the data value

READNUM (Skey,Sident,Ddef) : D

ReadNum returns a numeric value from a specified data value associated with a key.

Skey is a string that identifies the key from which to retrieve a data value. Sident is a string that identifies the name of the data value to return. Ddef is a numeric value to use if there is no key corresponding to Skey or no data value corresponding to Sident.

WRITENUM (Skey,Sident,D)

WriteNum stores a numeric value in a data value associated with a specified key.

Skey identifies the key into which to store a data value. Sident identifies the name of the data value into which to write. D is the value to write into the data value

KEYEXISTS (Skey) : Dbool

Verifies if the key Skey exists.

DELETEKEY (Skey) : Dbool

Deletes the key identified by Skey.

Properties

FILENAME

Returns the base key (the key value passed as an argument to the constructor CREATE)

 
Example:

reg := Registry.Create("Software\TechWIN\JOPPS");
joppshomepath := reg.ReadString("START","InFolder","");
reg.Free();
ShowMessage("JoPPS is installed in folder "+joppshomepath+"");

Important: Do not mess around with the Windows registry - you can corrupt your system !

 




 |  History  |
 
 

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