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

Username:   Password: 
 RegisterRegister   
 Enter & r keypress
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Punde




PostPosted: Sat Feb 22, 2003 6:09 am   Post subject: Enter & r keypress

Hello,
I want to add to my program a line that says "Press r to rerun enter to continue" I have tried everything and got the r part but not the enter part. I want ONLY r to rerun and ONLY when the user presses Enter the program will continue. Any help with this??? Thx.

[EDIT]
I have another problem Sad
I want to make this flag program that displays 5 flags coming from the top going downwards and stopping before they reach the end of the window. I want to do this using a module by making a procedure and calling them on the main program ( I know how to do this part). Can anyone help me with the flag going downwards part??? Thx again.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Feb 22, 2003 10:14 am   Post subject: (No subject)

ASCII value for r is 114 and for "Enter" its 10.

code:

var c:string(1)
getch(c)
put ord(c)

will tell you the ascii value of any key.

About flags going down, just redraw the picture a bit lower... so put that inside a forloop.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Punde




PostPosted: Sat Feb 22, 2003 12:43 pm   Post subject: (No subject)

I got the flags now, but I still don't know how to do the Enter and R keypress. Can anyone tell me how??
Tony




PostPosted: Sat Feb 22, 2003 2:22 pm   Post subject: (No subject)

i told you, ASCII values for r is 114 and "enter" is 10. Doesn't anyone read Evil or Very Mad ?

so
code:

var c:string(1)
getch(c)
if c=chr(114) then
put "you pressed r"
elsif c=chr(10) then
put "you pressed enter"
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Dan




PostPosted: Sun Feb 23, 2003 2:37 pm   Post subject: (No subject)

if you still need more help look at this post:

http://danco.no-ip.com/turing/viewtopic.php?t=285

it is so close to being the same question it is funny, odd how that is, eh?
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: