Getting input from system_ ?

BlitzMax Forums/BlitzMax Programming/Getting input from system_ ?

kronholm(Posted 2008) [#1]
Running the following outputs 'hello_world' to the console inside the blitmax IDE.

system_("php -r echo('hello_world!');")


Now, I want to use this output inside of my blitzmax application. How can I do that? This doesn't work, it just prints out 0 if you print it:

local fromcmdline$ = system_("php -r echo('hello_world!');")



kfprimm(Posted 2008) [#2]
Use Pub.FreeProcess. I believe there's tutorial on it.

[edit]
Here, http://www.blitzbasic.com/Community/posts.php?topic=53709.
Once you have the process handle you can call something along the lines of process.pipe.ReadLine() and process.err.ReadLine() to get the output. I can't remember exactly off the top of my head. Take a look at the source code.