Jump to content

Recommended Posts

Posted (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 by brodie28
Posted (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 by Manadar
Posted

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.

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
  • Recently Browsing   0 members

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