Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ABC Test Program Posted by Pajni on 5 Jul 2005 at 10:32 AM
Hi, Im making a program were you can test how fast you can type the alphabeticts(spelling?)

Anyways, I got stuck. I was thinking of a TTimer to check what keys are pressed and in the correct order every ms. As for were I got stuck I don not know what code I should use. Here is a little example of what I mean, but its not functioning. anyways, If the user press wrong key the user fails. Hope I explained good :S

If key 'a' then
if key 'b' then
if key 'c' then

etc

else label1.caption:='Failure';

just wrote this as a quick example of what I mean.
Report
Re: ABC Test Program Posted by IDK on 5 Jul 2005 at 10:54 AM
: Hi, Im making a program were you can test how fast you can type the alphabeticts(spelling?)
:
: Anyways, I got stuck. I was thinking of a TTimer to check what keys are pressed and in the correct order every ms. As for were I got stuck I don not know what code I should use. Here is a little example of what I mean, but its not functioning. anyways, If the user press wrong key the user fails. Hope I explained good :S
:
: If key 'a' then
: if key 'b' then
: if key 'c' then
:
: etc
:
: else label1.caption:='Failure';
:
: just wrote this as a quick example of what I mean.
:
I have done the same thing in basic.
If you are interested I could give
you the code.

I did with a smart sulution in ascii.

Niklas Ulvinge aka IDK

Report
Re: ABC Test Program Posted by Pajni on 5 Jul 2005 at 11:52 AM
actually I got it working now by "cheating" I did an mainmenu1 with the keys binded to each letter. The "code" I used so the user cant cheat or anything like that I just used:

b.enabled:=true
a.enabled:=false

etc on every key.

But this doesnt really stop the player from failing when the wrong key is pressed.

anyways, I got a newbieproblem here, as if the other question wasnt =)

this code:

Memo1.lines.Add:=inttostr(sec)+':'+inttostr(hundradel);

doens work, what did I miss ?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.