Computer Science Canada

Ord finder

Author:  shorthair [ 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

Author:  Tony [ Tue Jan 20, 2004 3:06 pm ]
Post subject: 

you dont need
code:

    loop
        exit when hasch
    end loop

part... it works fine without Laughing

Author:  sport [ Tue Jan 20, 2004 10:40 pm ]
Post subject: 

it is pretty useful for the user controls when coding.

Author:  Maverick [ Tue Jan 20, 2004 11:00 pm ]
Post subject: 

Hey I like that. Very useful

+Bits

Author:  McKenzie [ Tue Jan 20, 2004 11:01 pm ]
Post 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.

Author:  shorthair [ Wed Jan 21, 2004 6:14 am ]
Post 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


: