fb:porticula NoPaste
Pause statt "sleep"
Uploader: | tom_dehn |
Datum/Zeit: | 13.12.2015 21:09:07 |
Function pause (msg As String="Press any key when ready", seconds As single=0) As String
'' aus der Reihe quick & dirty :)
'' tom dehn
'' usage: try and find out
Var lastkey="",s1=msg,Start=Timer()
Do : Loop While Len(InKey) '' donno if needed, clear kbd buffer
? s1
Do
Sleep 100,0
LastKey=InKey '' this is the Result
If lastkey <> "" Then exit do
If seconds=0 Then Start = Timer * 1.11 ' REFRESH forever
Loop Until (Timer - Start) > seconds
Function=LastKey
End Function
'' start "demos"
Dim As String s
pause
pause "do s.th.!"
pause "do s.th. or wait 4.56 secs",4.56
? "Next Is Wait only. This msg is ?ed :)"
pause "",4.56
Do
s= pause("...also returns 'xtended' keys: ")
For i As Integer=0 To Len(s) -1 :? s[i];" ";:Next:?
Loop Until Asc(s) = 27
end