We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What command should I use to make my program pause until the user presses a key?
#4
(translated by Google translator)

Hello Elzaimer.
I don't speak English well. Therefore, it is difficult for me to explain my thoughts to you. But I'll try.

Although I am also a newbie, I see that you declared an event handler subroutine " GraphicsWindow.KeyDown = test " inside the loop. And now, the subroutine is declared every time the loop is executed. And the handler subroutine must be declared once at the beginning of the code of the entire program.

Also, there doesn't seem to be any code in your "test" routine that tells the program what to do if no key is pressed. Therefore, the program does not stop and does not wait for a key to be pressed.

And I also know that the event handler routine should contain as little code as possible. You can see this in some example.

Shy
[-] The following 1 user Likes AbsoluteBeginner's post:
  • Elzaimer
Reply


Messages In This Thread
RE: What command should I use to make my program pause until the user presses a key? - by AbsoluteBeginner - 06-24-2024, 12:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)