
-----------------------------------
Aziz
Sat Jun 25, 2005 5:04 pm

Changing position of text cursor.
-----------------------------------
How would I go about changing the position of the text cursor (like a locate command in turing)

-----------------------------------
wtd
Sat Jun 25, 2005 5:11 pm


-----------------------------------
You don't.  You print to the standard output, rather than a special window as in Turing.  It's just linear text.

Why do you think you need this capability anyway?  (What are you trying to accomplish?)

-----------------------------------
Aziz
Sat Jun 25, 2005 5:26 pm


-----------------------------------
Just input, but idiot-proof. So if they type in a string when the program needs an integer I go back to original line. But I get what you're saying :)

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 5:44 pm


-----------------------------------
I know very limited Java, but wouldn't you do that with a simple loop?
loop
get input
if the input is an integer then continue the program
if the input is anything else then go back continue the loop

-----------------------------------
wtd
Sat Jun 25, 2005 5:55 pm


-----------------------------------
Yes, but I believe Aziz was trying to hide the original input.  

Bad practice in a text UI environment.  The ser knows they input that, so hiding it serves no purpose.

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 6:03 pm


-----------------------------------
Ok, I agree, he still might want it for aesthetic (sp?) purposes, I don't know.  Still, to do that wouldn't you just add a "clear the screen" to the loop?

-----------------------------------
wtd
Sat Jun 25, 2005 6:10 pm


-----------------------------------
"]Ok, I agree, he still might want it for aesthetic (sp?) purposes, I don't know.  Still, to do that wouldn't you just add a "clear the screen" to the loop?

There's no portable way to do that.  And not because no one has ever thought of doing it before.  ;)
