youkielkanish Posted May 16, 2006 Share Posted May 16, 2006 (edited) here is the code :$file = FileOpen("c:\jeux\sony\everquest II\logs\test.txt", 0)$file2 = FileOpen("c:\jeux\sony\everquest II\logs\test2.txt", 1)If $file = -1 ThenMsgBox(0, "Erreur", "impossible d'ouvrir le fichier.")ExitEndIfWhile 1 $line = FileReadLine($file) $text = StringReplace($line, "bonjour", "hello") If @extended = 1 Then MsgBox(0, "resultat :", $file & $text & @extended) FileWriteLine($file2, $text) Else $text = StringReplace($line, "au revoir", "good bye") If @extended = 1 Then MsgBox(0, "resultat :", $file & $text & @extended) FileWriteLine($file2, $text) EndIf EndIf If @error = -1 Then ExitLoopWendFileClose($file)FileClose($file2)so this was working very well, till i decided to take off the MsgBox that i didn t need anymore, the code then looked like :$file = FileOpen("c:\jeux\sony\everquest II\logs\test.txt", 0)$file2 = FileOpen("c:\jeux\sony\everquest II\logs\test2.txt", 1)If $file = -1 ThenMsgBox(0, "Erreur", "impossible d'ouvrir le fichier.")ExitEndIfWhile 1 $line = FileReadLine($file) $text = StringReplace($line, "bonjour", "hello") If @extended = 1 Then FileWriteLine($file2, $text) Else $text = StringReplace($line, "au revoir", "god bye") If @extended = 1 Then FileWriteLine($file2, $text) EndIf EndIf If @error = -1 Then ExitLoopWendFileClose($file)FileClose($file2)and since then i get this error msg: Edited May 16, 2006 by youkielkanish Link to comment Share on other sites More sharing options...
Lazycat Posted May 16, 2006 Share Posted May 16, 2006 Maybe your script is in Unicode, UTF or sometnig like? Autoit scripts should be plain ANSI. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
youkielkanish Posted May 16, 2006 Author Share Posted May 16, 2006 (edited) Maybe your script is in Unicode, UTF or sometnig like? Autoit scripts should be plain ANSI.actualy i m using notepad to edit my .au3 files and copying some text from a wordpad file, so i m coding in Unicode, but what can i use to change that Edited May 16, 2006 by youkielkanish Link to comment Share on other sites More sharing options...
youkielkanish Posted May 16, 2006 Author Share Posted May 16, 2006 well i did edit my .au3 file with wordpad and it seems to clear the error, i ll try it a bit more since i m note sur it s evaluating it in ANSI, thx for all Link to comment Share on other sites More sharing options...
Lazycat Posted May 16, 2006 Share Posted May 16, 2006 Not sure exactly, but it can. At least this looks like you try to run unicode file. Try to "Save As" you script and look what Encoding is.Good editors are lot, and this just matter of preference, but if you don't used before any, try Scite for Autoit3:http://www.autoitscript.com/autoit3/scite/downloads.php Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
youkielkanish Posted May 16, 2006 Author Share Posted May 16, 2006 Not sure exactly, but it can. At least this looks like you try to run unicode file. Try to "Save As" you script and look what Encoding is.Good editors are lot, and this just matter of preference, but if you don't used before any, try Scite for Autoit3:http://www.autoitscript.com/autoit3/scite/downloads.phpoki thx a lot, i ll try this one Link to comment Share on other sites More sharing options...
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