|
PasteIt Eintrag #181 |
| Autor: |
HAPM |
| Titel: |
ReadINISections |
| Beschreibung: |
kleine Funktion, die einem alle Sections in einem INI-File als array zurück gibt |
| Code |
- Function ReadINISections(File)
-
Dim data
-
Dim fh
-
Dim line
-
data = ""
-
fh = FileOpen(File, FA_Read)
-
Do While Not FileEOF(fh)
-
line = Trim(FileReadLn(fh))
-
If Left(line, 1) = "[" And Right(line,1) = "]" Then
-
data = data & Mid(line, 2)
-
End If
-
Loop
-
FileClose fh
-
If Len(data) > 0 Then data = Mid(data, 1, Len(data)-1)
-
ReadINISections = Split(data, "]")
-
End Function
|
|