Jump to content

Delete content of .txt file?


Recommended Posts

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]

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...