GETINI (return INI file entry)

Top  Previous  Next

 

GETINI( section ,entry [,default] [,file] )

GETINI

Returns 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 setting for which to return the value.

default

A string constant or variable containing the default value to return if the entry does not exist (up to 1023 characters). If omitted and the entry does not exist, GETINI returns an empty string.

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 does not exist, GETINI returns an empty string. If omitted, GETINI searches the WIN.INI file.

The GETINI procedure returns the value of an entry in a Windows-standard INI file (maximum file size 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:

[intl]

sLanguage=enu

sCountry=United States

iCountry=1

The GETINI procedure searches the specified file for the entry within the section you specify. It returns everything on the entry's line of text that appears to the right of the equal sign (=).

Return Data Type:

STRING

Example:

Value  STRING(30)

CODE

Value = GETINI('intl','sLanguage')    !Get the language entry

 

See Also:

PUTINI