mads3n 0 Posted June 9, 2005 I need a little help.. is there a code to delete the content of a .txt file?? plz....help me.. Mads3n.dk Share this post Link to post Share on other sites
vbMark 0 Posted June 9, 2005 I need a little help..is there a code to delete the content of a .txt file??plz....help me.. <{POST_SNAPBACK}>#include <file.au3> _FileCreate ( $sFilePath ) Share this post Link to post Share on other sites
Groumphy 0 Posted June 9, 2005 Why not this : ; Function to empty a text file ; Author(s) : Groumphy ; Alias of FileOpen Mode 2 Func _EraseContentOfTxtFile($iFile) ; failure = -1 ; success = File is empty Return FileOpen($iFile, 2) FileClose($iFile) EndFunc _EraseContentOfTxtFile("test.txt") If @error Then MsgBox(0 + 64, "Info", "Error !", 10) Else MsgBox(0 + 64, "Info", "Success !", 10) EndIf ----------------------GroumphyMore information about me [Fr] Share this post Link to post Share on other sites
mads3n 0 Posted June 9, 2005 Why not this : ; Function to empty a text file ; Author(s) : Groumphy ; Alias of FileOpen Mode 2 Func _EraseContentOfTxtFile($iFile) ; failure = -1 ; success = File is empty Return FileOpen($iFile, 2) FileClose($iFile) EndFunc _EraseContentOfTxtFile("test.txt") If @error Then MsgBox(0 + 64, "Info", "Error !", 10) Else MsgBox(0 + 64, "Info", "Success !", 10) EndIf <{POST_SNAPBACK}>¨Thx.. Mads3n.dk Share this post Link to post Share on other sites
Valuater 129 Posted June 9, 2005 #include <file.au3> _FileCreate ( $sFilePath )<{POST_SNAPBACK}>I would use your idea... quick, clean, short, to the point and does exactly what he asked for8) Share this post Link to post Share on other sites