woodpecker 0 #1 September 26, 2006 finished a simple program (while statement and a nextLine) but need the program to stop when I hit enter. I'll send program if you need. BillySONIC WOODY #146 There is a fine line between cockiness and confidence -- which side of the line are you on? Quote Share this post Link to post Share on other sites
simplyputsi 0 #2 September 26, 2006 it's been awhile since I programmed and I did C++ but it's close. You should just be able to insert and if statment if(keystroke=enter) { return(0) } something to that effect. I don't know what you have to put in computer language for the keystroke=enter part though and I'm not positive about the return(0) part. YOu get the jest though no?Skymama's #2 stalker - Quote Share this post Link to post Share on other sites
cybercom 0 #3 September 26, 2006 Or do { something else }while(key=0) Quote Share this post Link to post Share on other sites
matt1215 0 #4 September 26, 2006 I'd nest this somewhere in your while loop: If keystroke = { break } You might have to use exit instead of break Quote Share this post Link to post Share on other sites
bob.dino 1 #5 September 26, 2006 System.in provides the InputStream you need to read from the console. InputStreamReader provides the bridge to characters from bytes. InputStreamReader.read() will read a single character. It's blocking, so you may also need to use System.in.available(). If this isn't enough info to get you started, PM me. Quote Share this post Link to post Share on other sites
kirrz 0 #6 September 27, 2006 QuoteSystem.in provides the InputStream you need to read from the console. InputStreamReader provides the bridge to characters from bytes. InputStreamReader.read() will read a single character. It's blocking, so you may also need to use System.in.available(). If this isn't enough info to get you started, PM me. isn't dave awesome for programming help! Quote Share this post Link to post Share on other sites Join the conversation You can post now and register later. If you have an account, sign in now to post with your account. Note: Your post will require moderator approval before it will be visible. Reply to this topic... × Pasted as rich text. Paste as plain text instead Only 75 emoji are allowed. × Your link has been automatically embedded. Display as a link instead × Your previous content has been restored. Clear editor × You cannot paste images directly. Upload or insert images from URL. Insert image from URL × Desktop Tablet Phone Submit Reply 0