Function Reference

IniReadSectionNames

Reads all sections in a standard format .ini file.

IniReadSectionNames ( "filename" )

 

Parameters

filename The filename of the .ini file.

 

Return Value

Success: Returns an array of all section names in the INI file.
Failure: Sets @error on failure.

 

Remarks

A standard ini file looks like:
[SectionName]
Key=Value


The number of elements returned will be in $result[0]. If an @error occurs, no array is created.
Only the first 32767 chars are taken in account in an section due to Win9x compatibility.

 

Related

IniDelete, IniWrite, FileReadLine, IniRead, IniReadSection, IniRenameSection, IniWriteSection

 

Example


$var = IniReadSectionNames(@WindowsDir & "\win.ini")
If @error Then
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $var[0]
        MsgBox(4096, "", $var[$i])
    Next
EndIf