I'm trying to pause a for next loop until a global variable called status is set to 1.
The global status variable gets set with Astreams_Newdata if the correct data is received.
I've tried things like :-
I've also tried a couple of different delay subs but none seem to really work correctly, like these:-
The global status variable gets set with Astreams_Newdata if the correct data is received.
I've tried things like :-
B4X:
Do Until status = 1
Sleep(0)
Loop
I've also tried a couple of different delay subs but none seem to really work correctly, like these:-
B4X:
Sub Delay(Time As Long)
Dim jo As JavaObject
jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array(Time))
End Sub
Sub Wait(ms As Int)
Dim n As Long = DateTime.Now + ms
Do While DateTime.Now < n
Loop
End Sub