stdin, stdout howto

Just starting out? Need help? Post your questions and find answers here.
karu
Enthusiast
Enthusiast
Posts: 255
Joined: Fri Jan 13, 2006 12:14 am

stdin, stdout howto

Post by karu »

Hi, i have a program(1) that launch the other program(2). After the program 1 is launched the program 2, program 1 send message to program 2 stdin, program 2 receive message, do something with it and write message to stdout and program 1 receive it. Program 1 can be done in purebasic, but problem is that i cant find howto do program 2 in purebasic, beacause purebasic stdin an stdout working only in "master" mode like program 1, where it runs program and afte that use stdin and stdout, i cant find solution how to use stdin and stdout without running program.
In help is line: ReadProgramString Reads a line from the output (stdout) of the given program. The program must have been started with RunProgram()

Thanks
Karu
infratec
Always Here
Always Here
Posts: 7625
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: stdin, stdout howto

Post by infratec »

Hi karu,

you have to open a console,
then you can use ReadConsoleData() and WriteConsoleData() for stdout and stdin.
ConsoleError() for stderr.

Bernd
Post Reply