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.
 

Discorez

Member
Licensed User
Longtime User
...or simple equivalent
B4X:
'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

Jost aus Soest

Active Member
Licensed User
Longtime User
You could use a sub like this:
B4X:
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

skoda777

Member
Licensed User
Longtime User
Thank you very much, i'll try it.
 
Upvote 0

skoda777

Member
Licensed User
Longtime User
Thank you very much, i'll try em both.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…