Access/VBA Library


Private function which returns a String containing the name of the section. This is the value before the first dot in index.

When no section is specified, the default section ('config') is returned.


GetSectionFromIndex( index )
Name Type Description
index String Required. Pair of section and key, separated by a dot.
Return value

String : Name of the section.

Private Function GetSectionFromIndex(index As String) As String

    Dim pos As Integer
    pos = InStr(index, ".")
    If pos = 0 Then
        GetSectionFromIndex = cDefaultSection
        GetSectionFromIndex = Left$(index, pos - 1)
    End If
End Function