We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › How to Input string/values (beginner)
Page Index Toggle Pages: 1
How to Input string/values? (beginner) (Read 793 times)
How to Input string/values? (beginner)
Oct 2nd, 2005, 1:53pm
 
...such as the INPUT (BASIC) command and cin in c++?
Re: How to Input string/values? (beginner)
Reply #1 - Oct 2nd, 2005, 3:53pm
 
There's no such thing really (to my knowledge).

If Java has a console programming environment, then Processing covers that.

There's no input like CIN unless you write it yourself through void keyPressed()
Re: How to Input string/values? (beginner)
Reply #2 - Oct 2nd, 2005, 4:18pm
 
It's possible, but it's a inherently different approach to programming.  Processing creates GUI applications that do not use a console whatsoever.  If you were to run your own main() process, you could use System.in/System.out much as you would use them in c or c++, but you will notice when you run a processing application, there is no interactive console (the output screen in the IDE does not support input, as far as I know).

So to input you would likely what to do it from the GUI. Perhaps make a class with a String or StringBuilder member variable, then with each call to keyTyped(), add a letter to the buffer (checking for backspace and enter keys).

Marcello
Page Index Toggle Pages: 1