Page 1 of 1

Input/Output PB 4.0 Beta 5

Posted: Mon Mar 06, 2006 5:16 pm
by Ninja
Hi i got a little problem with the Purebasic 4.0 Beta 5:

Code: Select all

console.l = RunProgram("cmd","","",#PB_Program_Open|#PB_Program_Read|#PB_Program_Write)

Repeat

If AvailableProgramOutput(console)
 Debug ReadProgramString(console)
EndIf

Debug "running"
Delay(500)
ForEver
The "running" should be printed the whole time and if output is aviable it should also be printed.
Why does this (after a short output) stop until the cmd.exe is closed mannually? Is there a way (without threads) to prevent this problem?
I hope someone of you can help me!

Greetz

Posted: Mon Mar 06, 2006 5:39 pm
by Fred
ReadProgramString() needs an 'carriage return' to return, else it will block. You probably want to use ReadProgramData() here.

Posted: Mon Mar 06, 2006 5:45 pm
by Ninja
I've already tried it with readprogramdata, it doesn't work.