 Unit Profile
 

The Profile unit provides access to INI files in Windows' style for
DOS and DPMI applications. File access is done via a specially adapted
buffered stream for optimal speed. The procedures are compatible to
these defined in Windows' API.

 Unit Profile: Functions and Procedures 
 Copyright                              


 Unit Profile: Functions and Procedures
 

 GetPrivateProfileInt     
 GetPrivateProfileString  
 WritePrivateProfileString

 See also:  Unit Profile

 GetPrivateProfileInt          (Unit Profile)
 
 function GetPrivateProfileInt(ApplicationName, KeyName: PChar;
   Default: Integer; FileName: PChar): Word;

This functions retrieves the integer value of a certain entry
in a certain INI file.

 Parameter         Description
 
 ApplicationName   Null-terminated string, stating the section name.
 KeyName           Null-terminated string, stating the key name whose
                   value is to be retrieved.
 Default           Integer value to be returned if the key is not present.
                   Must be a positive integer from 0 to 32,767.
 Filename          Null-terminated file name.

Returns:

The functions returns the integer value of the entry specified if the
function was successful. If the entry does not exist, the Default value
is returned. If the entry is non-integer, 0 is returned.

Note:

The integer value can be followed by non-numeric characters, which are
ignored. The case of the keywords is ignored. Hexadecimal notation
is not recognized.

See also:

 GetPrivateProfileString
 INI File Format        


 GetPrivateProfileString       (Unit Profile)
 
 function GetPrivateProfileString(ApplicationName, KeyName: PChar;
   Default: PChar; ReturnedString: PChar; Size: Integer;
   FileName: PChar): Integer;

This function retrieves a string from a certain entry in an INI file.

 Parameter         Description
 
 ApplicationName   Null-terminated string, stating the section name.
 KeyName           Null-terminated string, stating the key name.
 Default           Null-terminated string, which is copied if the
                   specified entry is not available. This parameter
                   must not be NIL.
 ReturnedString    The buffer, to which the string is to be copied.
 Size              The size of the buffer.
 Filename          Null-terminated file name.

Returns:

The function returns the number of characters copied to the buffer, without
the terminating NUL characters.

Note:

The functions searches the specified section of the INI file for an entry
named KeyName. If found, the string value is copied to the buffer. If not,
the Default string is copied.
If Keyname is set NIL, the function will copy all names of the specified
section to the buffer. Each name is null-terminated, and the buffer is
terminated by another NUL character.
If the string linked with Keyname is given with (single or double)
quotation marks, these characters are removed.
The case of the keywords is ignored.

See also:

 WritePrivateProfileString
 INI File Format          


 WritePrivateProfileString     (Unit Profile)
 
 function WritePrivateProfileString(ApplicationName, KeyName, Str,
   FileName: PChar): Boolean;

This function copies a string into a certain section of an INI file.

 Parameter         Description
 
 ApplicationName   Null-terminated string, stating the section name.
                   If the section does not exist, it is created. The
                   case is ignored.
 KeyName           Null-terminated string, stating the key name.
                   Set KeyName NIL if the whole section is to be deleted.
 Str               Null-terminated string, stating the new value of
                   the entry. Set Str NIL if this entry is to be deleted.
 Filename          Null-terminated file name. If non-existing, the
                   file is created.

Returns:

The function returns TRUE if it was successful.

Note:

For improving performance of access, the Profile unit leaves accessed
INI files open. For closing the file, call this function with all four
parameters set NIL.

See also:

 INI File Format


 INI File Format
 

INI files are text files. They consist of several so-called application
sections.

 [Section1]
      :
      :
 [Section2]
      :
      :
      :
 [LastSection]
      :
      :

In each section there are entries of the following format:

 Entry1=1000
 Entry=no
      :
 LastEntry=Example

Left of the equal sign there is the so-called keyword, which identifies
the entry. You refer to this keyword to retrieve or change the value of
an entry. This value is to be found to the right of the equal sign.

See also:

 Unit Profile


 Copyright and
 Disclaimer of Warranty
 

The files of the software product provided as a whole are called Software.

 Copyright

 The Software is neither "Public Domain",
 nor "Freeware". The Software is protected
 by the laws of the Federal Republic of
 Germany and international agreements.

 Copyright (C) 1993, 1994 Matthias Kppe,
 Erzbergerstrae 12, D-39104 Magdeburg.
 All rights reserved.

 Disclaimer of Warranty

 The Software is supplied as is. The authors
 disclaim all warranties, expressed or
 implied, including but not limited to the
 warranties of merchantability and of fitness
 for any purpose. The authors assume no
 liability for damages, direct or
 consequential, which may result from
 the use of the Software.

 General Agreement

 Using the Software, you agree to the general
 agreement, which is stated in the file
 SOFTWARE.DOC.

 If you have a copy of the Software that
 doesn't include this file, refer to:

 Matthias Koeppe
 MKM GbR f. Softwareentwicklung
 Erzbergerstrae 12
 D-39104 Magdeburg
 GERMANY

 Phone/Fax  +49-391-5 43 01 28
 CIS        [100331,174]

