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

Username:   Password: 
 RegisterRegister   
 Getch (key) :d
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Strawberry




PostPosted: Thu Dec 31, 2009 9:36 pm   Post subject: Getch (key) :d

Using getch (key)
how do you make the previous procedure automatically display the next procedure?




Sorry, I am new to turing. Smile
Sponsor
Sponsor
Sponsor
sponsor
DtY




PostPosted: Thu Dec 31, 2009 10:29 pm   Post subject: RE:Getch (key) :d

That question doesn't make sense, can you give an example of what this would do?
StuartG




PostPosted: Mon Jan 04, 2010 7:34 pm   Post subject: RE:Getch (key) :d

The only way i could think of this being used is that at the end of your procedure you basically freeze the program until any key is pressed then it runs the next...

such as:

var KEY : string (1)

proc TEST2
put "Success"
end TEST2

proc TEST
put "Press any key to run next proc:"
getch (KEY)
TEST2
end TEST

TEST
Strawberry




PostPosted: Wed Jan 06, 2010 7:40 pm   Post subject: RE:Getch (key) :d

THANKS Smile
Turing_Gamer




PostPosted: Wed Jan 06, 2010 7:46 pm   Post subject: Re: Getch (key) :d

You can do this...

Turing:
var reply : string % Making sure that the reply is a string will give the program more variety
                    % Certain functions may require to make the string a specific length -> 'string (#)'
put "Enter 'a' to do function 1 and 'b' to do function 2"
get reply

Then you can follow up with 'if' statements to check if they match your reply

Another possibility is using a hasch and getch command like the following...

Turing:
if hasch then
    getch (command)
    %Write if statements saying if command matches specific char
end if


I'm not sure if they will apply to procedures
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: