Init (initialize the INIClass object)

Top  Previous  Next

 

Init (FileName, [NvType], [ExtraData])

Init

Initializes the INIClass object.

filename

A string constant, variable, EQUATE, or expression containing the INI file name. If filename specifies a full path, the INIClass looks for the file in the specified path. If no path is specified, the INIClass looks for the file in the Windows directory. If filename is specified as null (''), the INIClass uses the WIN.INI file.

NvType

An UNSIGNED integer that conforms to the following equates:

NVD_INI

use named INI file.

NVD_Registry

use the system registry (ignores the filename parameter)

NVD_Table

use a local table – NOT SUPPORTED YET

ExtraData

A LONG integer. When the registry is used in the second parameter, ExtraData is used to specify the part of the registry to use as the root of all entries. Valid values are:

REG_CLASSES_ROOT

REG_CURRENT_USER

REG_LOCAL_MACHINE

REG_USERS

REG_PERFORMANCE_DATA

REG_CURRENT_CONFIG

REG_DYN_DATA

The Init method initializes the INIClass object.

Implementation:

The Init method assigns filename to the FileName property.

Example:

 INCLUDE('ABUTIL.INC')

INIMgr               INIClass

CODE

INIMgr.Init('c:\MyApp\MyApp.INI') !read & write from c:\MyApp\MyApp.INI

INIMgr.Init('.\MyApp.INI')        !read & write from currentdirectory\MyApp.INI

INIMgr.Init('')                   !read & write from c:\Windows\WIN.INI

INIMgr.Init('MyApp.INI')          !read & write from c:\Windows\MyApp.INI

 

INIMgr.Init('', NVD_Registry, REG_LOCAL_MACHINE)

!read & write from Windows system registry, using LOCAL_MACHINE as the root

 

INIMgr.Init('CONFIG.TPS',NVD_Table)

!read & write from a local table

 

See Also:     FileName GETREG, PUTREG, DELETEREG