Jump to content
Sign in to follow this  

StdoutRead to FileWriteLine but only what's new

Recommended Posts


I have a script that gives me some stdout. I want to write it in a file. The problem is that it's repeating same stuff all the time.

For instance, script A writes to console "This is a test".

Then, my GUI writes this into an edit box:

If _IsChecked($chbSit1) Then
                $leerSit1 = StdoutRead($pidSit1) & $leerSit1
                GUICtrlSetData($editSit1, $leerSit1)

So far, fine. Problem is, I want to write this into a file but ONLY the new lines that showed up in stdoutread($pidsit1). Because if I just do this:

FileWriteLine($fileNameColHandle, GUICtrlRead($editCol))

What I get is a file with $editcol text repeated again and again.

How can I write only new lines into the file using stdout?



PS: Also, when using GUICtrlSetData($editCol, $leerCol) I'm pasting all the text everytime. If I can only get new lines from stdout, is there a way to append lines in the edit box?


Edited by DLXS

Share this post

Link to post
Share on other sites

Maybe you should filter the stdout output by reading using a while loop (look at the example for StderrRead in the helpfile)

To append text in an edit you have to use a param : GUICtrlSetData ($edit, $data, 1)

Share this post

Link to post
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
Sign in to follow this  

  • Create New...