Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Changing position of text cursor.
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Aziz




PostPosted: 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
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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 Smile
[Gandalf]




PostPosted: 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




PostPosted: 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]




PostPosted: 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




PostPosted: 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. Wink
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: