We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there, I have an executable file which has to run via command line (cmd). I would like to run it from the Processing and read output data (String) from it. How can I write and read data to a console process like this? I am a newcomer here, please don't mind me if I made mistakes.
Answers
The bottom console window of Processing's IDE is for output only.
Only by running an already compiled program from a terminal would allow us to use console input operations!
Nonetheless, there's a class called JOptionPane which can pop-up message & input dialog boxes! <):)
Here's an example from this thread: http://forum.processing.org/two/discussion/869/check-array-contents-with-arraylist
Other old threads about it: :bz
http://forum.processing.org/one/topic/slight-miscalculation-with-code-for-discounts
http://forum.processing.org/two/discussion/1724/how-to-create-an-interface-asking-username-and-correct-password-
You should use Java's ProcessBuilder.
I just found an article showing how to use it http://tamanmohamed.blogspot.fr/2012/06/jdk7-processbuilder-and-how-redirecting.html (not read yet...)
Oh, thank's! I was not aware that JOptionPane is working in Processing ;)