This is total b*shit, guys, tell me, where I suck. I'm using a console application to read some value and return it to me. I get the correct value ok, at least when displayed in a message box, but then, when I use it in an IF statement (or any other comparison for that matter), I get some crap, have a look, here's the script: $id = Run(@ComSpec & " /c C:\temp\GetValue.exe ChannelName", "C:\temp", @SW_HIDE, 2) While 1 $line = StdoutRead($id) If @error Then ExitLoop If $line <> "" then $ChannelValue = $line sleep(50) Wend MsgBox (0, "", $ChannelValue) If $ChannelValue <> 500 Then MsgBox (0, "", "ChannelValue is something else") $ChannelValue = 1 EndIf The problem is, I see 500 in the message box, but then, the "ChannelValue is something else" is also displayed How come that StdoutRead function returns a value that I couldn't compare?