myspacee Posted July 27, 2009 Posted July 27, 2009 hello to all, have some problem to open some txt files. Attach one for test : post some code : $file = FileOpen("pvv08o", 0) $bar = FileRead ($file) ;inserisco tutto il file in una variabile ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit Else MsgBox(0, "file", $bar) EndIf FileClose($file) open file is OK, but reading and return content not. Anyone can help, please ? m.
picaxe Posted July 27, 2009 Posted July 27, 2009 $file = FileOpen("pvv08o", 0) $bar = StringReplace(FileRead($file), Chr(0), "") ;inserisco tutto il file in una variabile ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit Else MsgBox(0, "file", $bar) EndIf FileClose($file)
myspacee Posted July 27, 2009 Author Posted July 27, 2009 Thank you for reply, so file contains NULL ansi char. To prevent any other similar issue, can i replace other special ansi chars ? Thank you, m.
picaxe Posted July 27, 2009 Posted July 27, 2009 To prevent any other similar issue, can i replace other special ansi chars ?I've only noticed null chars causing problems with msgbox and regexp (because AutoIt uses pcre library).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now