Remove of #pb_any
Posted: Sat Oct 22, 2011 6:28 pm
as a optional parameter in the compiler options (default off).
so instead of
it should be
Maybe it is possible to use it as an optional parameter.
maybe it would be nice something like this:
at the moment something linke this is possible:
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