<-- Previous || Up || Next -->

Get Private Profile String Function
Windows API Class

Public Function GetPrivateProfileString( _
      ByVal vKeyName As Variant _
    , Optional ByVal vDefault As Variant _
    , Optional ByVal vSectionName As Variant _
    , Optional ByVal vFileName As Variant _
    ) As Variant

Get the value of a String setting from a Windows Private Profile (INI) file.

Example:
    Assuming
       Dim estWAPI As New WindowsAPI
       estWAPI.ProfileFileName = "Sample.Ini"
       estWAPI.ProfileSectionName = "Sample Section"
       estWAPI.WritePrivateProfileString("Convert From", "5 kilometers") = True
    for example
       estWAPI.GetPrivateProfileString("Convert From") = "5 kilometers"
See also:
    WritePrivateProfileString Function
    GetPrivateProfileInt Function
    GetPrivateProfileSection Function
    GetProfileString Function
    ProfileFileName Property
    ProfileSectionName Property
    GetPrivateProfileString Function (Windows API)
    GetSetting Function (Visual Basic 4.0+; not directly related)
vKeyName: Name of the String setting whose value is to be retrieved. Function returns Null if vKeyName is Null or cannot be fixed-up to a String.
vDefault: Default value that will be returned by this function where there is no setting with the specified Name. vDefault defaults to an empty string ("") if it is missing or Null or cannot be fixed-up to a String.
vSectionName: The Section within the Private Profile file that contains the Setting. vSectionName defaults to the current value of the ProfileSectionName Property if it is missing or Null or cannot be fixed-up to a String.
vFileName: The name of the Private Profile (INI) File that contains the Setting. vFileName defaults to the current value of the ProfileFileName Property if it is missing or Null or cannot be fixed-up to a String.
v1.3 Change: Removed 16-bit support from this function.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.