Results 1 to 2 of 2
Thread: Running a script until [quit]
- 04-13-2011, 08:44 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 43
- Rep Power
- 0
Running a script until [quit]
I'm making a simple calculator. It does what it should do, but only one line. Now I'd like to expand it so it runs until the user writes quit, or similar.
I run the methods handling to calculator from a method called statment(). The brilliant method I scrabbled together starts an infinite loop...
If anyone could give a hint on how to get the script to run one row at the time after each other.Java Code://code opening input and boolean runStatus = true; while(runStatus) { map.put("ans",expression()); //expression() calculates one statement given by user. System.out.println(st.toString()); if(st.isEOL()) { System.out.println("Ans: " + map.get("ans")); } else if(st.getWord().equals("quit")) { runStatus = false; } else { System.out.println("Syntaxerror! Expected EOL not: "+st.toString()); } }
- 04-13-2011, 08:48 PM #2
Member
- Join Date
- Feb 2011
- Posts
- 43
- Rep Power
- 0
Similar Threads
-
Need to end program by typing quit and not -1!!! I have pasted my code for assistance
By sarchie109 in forum New To JavaReplies: 7Last Post: 11-23-2009, 08:42 AM -
Problem in running Java swing wizard in jre 1.6 while it is running in jre 1.4
By Sanjay Dwivedi in forum AWT / SwingReplies: 0Last Post: 08-26-2009, 01:03 PM -
How to make a game quit in BlueJ after entering a room
By alpdog14 in forum New To JavaReplies: 3Last Post: 04-20-2009, 09:53 PM -
Quit Button, Load new Frame, Timer Code
By IHateNetbeans in forum New To JavaReplies: 1Last Post: 03-18-2009, 03:58 PM -
Running a script within IE
By Java Tip in forum SWTReplies: 0Last Post: 07-25-2008, 02:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks