B4J Question Running in real time ?

saunwin

Active Member
Licensed User
Longtime User
The subroutine below takes approx. 7 seconds to complete.

The first line lblstatus.text="UPLOADING" updates a UI label - shouldn't this line complete before the 7 second wait ? or do the UI labels get updated on subroutine completion ?

Many thanks in advance.

B4X:
Sub upload_MouseClicked (EventData As MouseEvent)
    lblstatus.Text="UPLOADING !!!!"
     Dim b() As Byte = Array As Byte(58,48,50,48,48,48,48,48,51,48,55,48,48,70,52)
'In ASCII that equates to :,0,2,0,0,0,0,0,3,0,7,0,0,F,4 or :,02,00,00,03,07,00,F4
    astream.Write(b)
    log("Attempting to Erase the chip")
    wait(7000)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
shouldn't this line complete before the 7 second wait ? or do the UI labels get updated on subroutine completion ?
The changes are put into a list of "todo delayed updates" which will complete after the sub finishes...

I suggest to start a 7 seconds timer here and then do what you want to do when the timer tick raises
 
Upvote 0
Top