brodie28 Posted July 20, 2006 Share Posted July 20, 2006 (edited) I am having trouble with this code... $locals = FileOpen ( "locals.txt", 1) For $number = 1 to 79 $line = FileReadLine ($locals, $number) MsgBox(0, "title", $line) next It works perfectly when I open the file in read mode, but when I open it in append mode the message box always shows up blank... I don't know why it would be doing that. Edited July 20, 2006 by brodie28 Link to comment Share on other sites More sharing options...
jvanegmond Posted July 20, 2006 Share Posted July 20, 2006 (edited) Get beta and use _FileWriteLine or something. Otherwise, read the whole file, split it (StringSplit($File,@CRLF)) and If stringinstr($split[$x] Then $return &= $split[$x] Not a full description, but you should know what to do. Edit: It looks fine to me, call a @error check to see if the file has been opened. Edited July 20, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
brodie28 Posted July 20, 2006 Author Share Posted July 20, 2006 Apparently a file cannot be in read and write mode at the same time... Which sucks because I will now have to have alot of file opening and closing going on during my script. Link to comment Share on other sites More sharing options...
jvanegmond Posted July 20, 2006 Share Posted July 20, 2006 No don't go there. Just open the file in write mode, it allows for reading also. github.com/jvanegmond 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