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.

DarkBASIC Discussion / Increasing Integers one keystrike at a time

Author
Message
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 11th Jan 2003 17:57
This is my code

rem
if lefkey()=1
A#=A#+1
endif
rem

What I want to happen is instead of the A# going up continuosuly as I hold the left key down, I want the A# to go up only 1 number every time I press the left key. How do I do this? For example, If I press the left key 10 times, the number will be 10. How do I do this?
AsriCE
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 11th Jan 2003 18:23
Try this code:



Asri Crew

Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 11th Jan 2003 19:07
I use this:

if leftkey() then inc a#: repeat:until leftkey()=0

Login to post a reply

Server time is: 2024-04-19 15:15:02
Your offset time is: 2024-04-19 15:15:02