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

Get Private Profile Section Function
Windows API Class

Public Function GetPrivateProfileSection( _
      ByRef rSection() As Variant _
    , Optional ByVal vSectionName As Variant _
    , Optional ByVal vFileName As Variant _
    ) As Boolean

Get all of the settings from a section of a Private Profile file and place them into a Variant array.
Function returns True upon success and False upon failure.

       Dim estWAPI As New WindowsAPI
       estWAPI.ProfileFileName = "Sample.Ini"
       estWAPI.ProfileSectionName = "Sample Section"
       estWAPI.WritePrivateProfileString("Convert From", "5 kilometers") = True
       estWAPI.WritePrivateProfileString("Convert To", "miles") = True
       Dim avarSettings() As Variant
    for example
       estWAPI.GetPrivateProfileSection(avarSettings()) = True
       LBound(avarSettings) = 0
       UBound(avarSettings) = 2
       ? avarSettings(1)
       Convert From="5 kilometers"
       ? avarSettings(2)
       Convert To="miles"
See also:
    ProfileSectionToVariantVector Function
    GetPrivateProfileSectionSample Subroutine
    GetPrivateProfileInt Function
    GetPrivateProfileString Function
    GetProfileSection Function
    ProfileFileName Property
    ProfileSectionName Property
    GetPrivateProfileSection Function (Windows API)
    GetAllSettings Function (Visual Basic 4.0+; not directly related)
rSection: Dynamic array of Variants that will receive the Settings. This array will be reinitialized with a lower-bound of 0 (zero) and an upper-bound of the number of Settings read. The settings will be copied into elements 1..N of the array.
vSectionName: The Section Name whose settings will be copied into the array. 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 Section to be read. 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.