so instead of
Code: Select all
ofile=OpenFile(#PB_Any, "Test.txt") ; öffnet eine existierende Datei oder erstellt eine, wenn sie noch nicht existiert
If ofile
FileSeek(ofile, Lof(0)) ; springt an das Ende der Datei (das Ergebnis von Lof() wird hierfür verwendet)
WriteStringN(ofile, "... another line at the end.")
CloseFile(ofile)
EndIf
Code: Select all
ofile=OpenFile( "Test.txt") ; öffnet eine existierende Datei oder erstellt eine, wenn sie noch nicht existiert
If ofile
FileSeek(ofile, Lof(0)) ; springt an das Ende der Datei (das Ergebnis von Lof() wird hierfür verwendet)
WriteStringN(ofile, "... another line at the end.")
CloseFile(ofile)
EndIf
maybe it would be nice something like this:
Code: Select all
if openfile(@ofile,"test.txt")
FileSeek(ofile, Lof(0)) ; springt an das Ende der Datei (das Ergebnis von Lof() wird hierfür verwendet)
WriteStringN(ofile, "... another line at the end.")
CloseFile(ofile)
EndIf
Code: Select all
Procedure.i myreadfile(*var.integer,file$)
*var\i=ReadFile(#PB_Any,file$)
ProcedureReturn *var\i
EndProcedure
Macro ReadFile(a,b)
myreadfile(@a,b)
EndMacro
If ReadFile(ofile, "Test.txt")
Debug "gefunden!"+Str(ofile)
CloseFile(ofile)
Else
Debug "das war nichts"
EndIf
If ReadFile(ofile, "c:\windows\directx.log")
Debug "gefunden!"+Str(ofile)
CloseFile(ofile)
Else
Debug "das war nichts"
EndIf