Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The program only wants to run once . . .
#12
the following code as suggested by Steve works most of the time but every now and then it simply prints -13
Code: (Select All)

Option _Explicit

Dim As Integer k
Dim As Double t
Print "Press a key"

t = Timer + 3.0 '<-- 2 seconds
Do
    k = _KeyHit
Loop Until k Or (Timer > t)
Print k

Pete
sleep doesn't work, it doesn't catch the key
Reply


Messages In This Thread
RE: The program only wants to run once . . . - by Jack - 07-31-2024, 12:52 AM



Users browsing this thread: 20 Guest(s)