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 / Need Help With Subroutine and Do Loop

Author
Message
Lexicon Devil
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 17th Dec 2003 05:35
I got a real problem here. Maybe I'm just dumb or something but I just can't figure this out. Anyway... I made a main menu for my Pong rip-off and one of the options is exit. So when you press enter when 'exit' is selected, a box will come up that says "are you sure?". So I put that in a subroutine where the box comes up and you can select yes(258 on the x axis) or no(280 on the x axis) and then press enter.

Well what happens is, when I select exit on the main menu and press enter, it goes to the subroutine and automatically selects yes and exits. I thought it was because the subroutine executed so fast, I was still holding enter when the box came up, but I don't know.

Anyway... If you're still reading this post, thanks in advance for any advice you might have.
Mougli
20
Years of Service
User Offline
Joined: 10th Dec 2003
Location: United Kingdom
Posted: 17th Dec 2003 10:49 Edited at: 17th Dec 2003 10:50
try adding this before the part where it goes to the subroutine that exits the loop:
"if returnkey()=1 then repeat:until returnkey()=0"

i think your right about it executing too fast and your still holding enter(this happens to me a lot,this is how i fix it)

Is the glass half empty - or half full?
you can have it all - Just not all at once
Lexicon Devil
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location:
Posted: 18th Dec 2003 02:31
Well thanks that sure is a good idea. There's only one problem; it didn't work. I was a little unsure on exactly where to put the code so i tried it in a few places.
I tried it here.


I also tried it here.



I also tried it like this.



See what happens is, when i press enter, it just freezes. Then i press enter again and it does the whole 'execute too fast and exit' thing. Does anyone have any insight?

Login to post a reply

Server time is: 2024-11-25 20:50:38
Your offset time is: 2024-11-25 20:50:38