Code-Beispiel
INI ohne API lesen
Lizenz: | Erster Autor: | Letzte Bearbeitung: |
GPL | ![]() | ![]() |
Hier ein kleiner Code, wie man INI-Dateien auch unter Linux lesen kann
Function ReadIni(IniFile As String, Section As String, Key As String) As String
Dim F As Integer
Dim T As String
Dim Found As Integer
f = FreeFile
open IniFile for input as #f
do
Line Input #f, T
if ucase(t) = ucase("["+Section+"]") then found = 1
loop until found = 1 or eof(f)
If Found = 0 then
close #f
Return ""
End If
Do
Line Input #1, T
if instr(T, "=") AND Left(T, len(Key)) = Key then
Close #f
Return Trim(Mid(T, instr(T, "=")+1, len(T)-Instr(T, "=")))
ElseIf Mid(T,1,1) = "[" then
Exit Do
End If
Loop Until eof(f)
Close #f
Return ""
End Function
Zusätzliche Informationen und Funktionen | |||||||
---|---|---|---|---|---|---|---|
|