Help with pascal please!

Associate
Joined
6 Feb 2008
Posts
1,750
Ok, very old language I know but I am just playing around, if anyone can help I will be very grateful.

Ok, I want to repeat something over and over on the screen until the user presses a key on the keyboard. I understand that usually you would use the lines:

Repeat
...
Until Keypressed;

But the problem is, I want to store what key they actually press. How do I do this?

Thanks

Stewart.
 
Associate
Joined
28 Jun 2005
Posts
895
VERY long time since I did this.

What you can do is but an IF statement at the end of the repeat loop.
(Pseudo code)
Code:
myChar = 0
REPEAT
...
IF keypressed THEN
    READKEY(myChar)
UNTIL myChar != 0

I think that will translate into something useful for you. But I haven't done it in such a long time
 
Back
Top Bottom