Gültig für NetWare, Symbian OS, UNIX, Windows und Windows CE.
Die Funktion "ExistFile" überprüft, ob eine bestimmte Datei vorliegt.
Funktionssyntax:
ExistFile(filename as String) as Boolean
Gibt den Dateipfad an.
Wenn die Datei vorhanden ist, wird TRUE zurückgegeben, andernfalls FALSE.
Beispiel:
Dim file, section, entry, value as string
Dim LF, CR as char
Dim rtr as integer
ClrScr()
LF = 0x0a
CR = 0x0d
file = "c:\dmscript.ini"
if Not(ExistFile(file)) then
rtr = CreateFile(file, O_TEXT)
if rtr = -1 then
SetStatus(1)
exit
end if
closeFile(rtr)
end if
section = "Section 1"
value = "Param_1 = Wert_1" + LF + "Param_2 = Wert_2"
if WriteIniSection( section, value, file) then
Print("WriteIniSection successfully completed.")
else
Print("WriteIniSection failed.")
endif
section = "Section 2"
entry = "Param_3"
value = "Wert_3"
if WriteIniEntry( section, entry, value, file) then
Print("WriteIniFile successfully completed.")
else
Print("WriteIniFile failed.")
endif
section = "Section 1"
rtr = ReadIniSection(section, value, file)
if (rtr > 0) then
Print( Str(rtr) + CR + LF + value)
else
Print("ReadIniSection failed.")
endif
section = "Section 2"
entry = "Param_3"
rtr = ReadIniEntry(section, entry, value, file)
if (rtr > 0) then
Print( Str(rtr) + CR + LF + entry + " = " + value)
else
Print("ReadIniEntry failed.")
endif
|
Copyright © 2014 CA Technologies.
Alle Rechte vorbehalten.
|
|