Is there a Sub_Pause() routine ?

skoda777

Member
Licensed User
Longtime User
Hi, is there a Pause routine or equivalent in b4a? I haven't come across one yet, and i have been searching for a while. If anybody can let me know I would greatly appreciate it.
 
...or simple equivalent
Code: Copy
'Interval in milliseconds
Sub Pause (Interval As Int) 
    Dim EndTime As Long
    EndTime = DateTime.Now + Interval
    Do While DateTime.Now < EndTime
        DoEvents
    Loop
End Sub
 
Upvote 0
You could use a sub like this:
Code: Copy
Sub Sleep(ms As Long)

  ms = DateTime.Now + ms
  Do While DateTime.Now < ms
    'DoEvents
  Loop

End Sub

If you want to pause for more than one second you should activate the DoEvents above - or really use a timer as suggested by Klaus.

___
OK, notice to myself: Don't phone while answering - you will be to late! ;)
 
Upvote 0
You could use a sub like this:
Code: Copy
Sub Sleep(ms As Long)

  ms = DateTime.Now + ms
  Do While DateTime.Now < ms
    'DoEvents
  Loop

End Sub

If you want to pause for more than one second you should activate the DoEvents above - or really use a timer as suggested by Klaus.

___
OK, notice to myself: Don't phone while answering - you will be to late! ;)
Thank you very much, i'll try em both.
 
Upvote 0
Back
Top