Posted: Sat Jun 25, 2005 5:04 pm Post subject: Changing position of text cursor.
How would I go about changing the position of the text cursor (like a locate command in turing)
Sponsor Sponsor
wtd
Posted: Sat Jun 25, 2005 5:11 pm Post subject: (No subject)
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
Posted: Sat Jun 25, 2005 5:26 pm Post subject: (No subject)
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]
Posted: Sat Jun 25, 2005 5:44 pm Post subject: (No subject)
I know very limited Java, but wouldn't you do that with a simple loop?
pseudocode:
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
Posted: Sat Jun 25, 2005 5:55 pm Post subject: (No subject)
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]
Posted: Sat Jun 25, 2005 6:03 pm Post subject: (No subject)
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
Posted: Sat Jun 25, 2005 6:10 pm Post subject: (No subject)
[Gandalf] wrote:
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.