Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Is there a better way of doing this code

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2004 18:18
Hi all

I have this code which I taken out of my main program so as t is easy to see what is going on.

now is there and easy'er or better way of coding this?

In Space No One can Hear You Scream! (When your comm Line is cut?)
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 9th Feb 2004 18:30
For upkey and downkey you can use upkey() and downkey() instead of scancode(). In such a small piece of code, its hard to make it easier, and efficiency isnt really a factor.

I would be unstoppable if I could just get started...
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2004 18:39
when its in my main code I some times press a key but there is no respons from the code it just sit there untill I press the key again.

This is way I am asking is there a better way of checking for a key press. it's for scrolling through text on the screen but I don't want it to fly pass. just one data line at a time.

In Space No One can Hear You Scream! (When your comm Line is cut?)
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 9th Feb 2004 18:43
Try testing for keystate( 200 ) and ( 208 ) rather than scancode. Something like:

if keystate( 200 ) = 1
do whatever
endif

I would be unstoppable if I could just get started...
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Feb 2004 18:53
Cheers I'll try that.

didn't know that one was aviable amazeing what you can miss when your not sure what to look for

In Space No One can Hear You Scream! (When your comm Line is cut?)

Login to post a reply

Server time is: 2024-09-21 20:58:12
Your offset time is: 2024-09-21 20:58:12