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

Username:   Password: 
 RegisterRegister   
 Help with making script continue on KeyDown.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MattehMatt




PostPosted: Fri Oct 31, 2008 6:15 pm   Post subject: Help with making script continue on KeyDown.

Alright, well I'm making small programs for assignments for school, I have the basics down and could probably ace the marking but I feel like going above and beyond.
What I'm trying to get work is for the program to ask if you want to restart the program and if the user answers yes to say something like "Press Enter to Continue", and when the enter key is pressed for the program to restart itself.

Any help would be appreciated.
Here's the scripting I've got done so far.


Quote:
var name1, name2, name3, name4, name5 : string
var reply : string
var chars : array char of boolean


setscreen ("graphics:max;max")
loop

put "Enter five full names, please seperate each by a line. (Press Enter)"
get name1 : *
get name2 : *
get name3 : *
get name4 : *
get name5 : *
put skip
put "Now watch how these names are rearranged to be backwards!"
put name5
put name4
put name3
put name2
put name1
put "ITS MAGIC!"
put "Do you want to flip around more names? Y/N "
get reply
exit when reply = "n" or reply = "N"
if reply = "y" or reply = "Y" then
put "Ok then! Press then down arrow when you want to start over!"
delay (100)
loop
Input.KeyDown (chars)
if chars (KEY_DOWN_ARROW) then
locate (19, 1)
put "And here we go again!"
delay (100)
cls
end if
end loop


end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Oct 31, 2008 10:16 pm   Post subject: RE:Help with making script continue on KeyDown.

get a variable. If it = 'yes' the do nothing. If it equals 'no' then exit the loop.
MattehMatt




PostPosted: Sat Nov 01, 2008 2:42 pm   Post subject: Re: Help with making script continue on KeyDown.

Thanks for that, instead I used a process with getch thanks tho Smile
ecookman




PostPosted: Sat Nov 01, 2008 4:18 pm   Post subject: RE:Help with making script continue on KeyDown.

turing=more than one solution... isn't it wonderful Smile
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  [ 4 Posts ]
Jump to:   


Style:  
Search: