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

Username:   Password: 
 RegisterRegister   
 Ord finder
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shorthair




PostPosted: Tue Jan 20, 2004 3:03 pm   Post subject: Ord finder

Ord finder , good for games ,whe n you need to knwo a key value

code:

setscreen("noecho")
var inkey : string (1)

loop
    loop
        exit when hasch
    end loop
    getch (inkey)
    put ord (inkey)
    exit when ord (inkey) = 27
end loop


Sniper GOT YA
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jan 20, 2004 3:06 pm   Post subject: (No subject)

you dont need
code:

    loop
        exit when hasch
    end loop

part... it works fine without Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
sport




PostPosted: Tue Jan 20, 2004 10:40 pm   Post subject: (No subject)

it is pretty useful for the user controls when coding.
Maverick




PostPosted: Tue Jan 20, 2004 11:00 pm   Post subject: (No subject)

Hey I like that. Very useful

+Bits
McKenzie




PostPosted: Tue Jan 20, 2004 11:01 pm   Post subject: (No subject)

Tony is right (as usual)
all the loop will do is wait for a key to be pressed (does not process it), well... getch already does that.
shorthair




PostPosted: Wed Jan 21, 2004 6:14 am   Post subject: (No subject)

Thanks for the feedback , i see what your saying with the loop now , im sure that i extracted this whole thing from a bigger program, im not sure why i had to loop in there , i was jsut going through some of my grade 10 files last night and came accross it
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: