Input/Output PB 4.0 Beta 5

Just starting out? Need help? Post your questions and find answers here.
Ninja
New User
New User
Posts: 7
Joined: Mon Mar 06, 2006 5:13 pm

Input/Output PB 4.0 Beta 5

Post 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
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

ReadProgramString() needs an 'carriage return' to return, else it will block. You probably want to use ReadProgramData() here.
Ninja
New User
New User
Posts: 7
Joined: Mon Mar 06, 2006 5:13 pm

Post by Ninja »

I've already tried it with readprogramdata, it doesn't work.
Post Reply