Private Sub ButtonQrOrigen_Click
B4XPages.ShowPage("Qr Code Reader")
Dim Resultado As String = QRC_Reader.Resultado
Log($"Resultado ${Resultado}"$)
End Sub
Como uds ya saben, el código anterior se ejecuta sin esperar a que finalice la pagina "Qr Code Reader".
Sé que podría emplear Wait, pero no sé como emplearlo en este caso.
He intentado con el siguiente código, pero no funciona
B4X:
Private Sub ButtonQrOrigen_Click
B4XPages.ShowPage("Qr Code Reader")
Wait For B4xPage_Disappear
Dim Resultado As String = QRC_Reader.Resultado
Log($"Resultado ${Resultado}"$)
End Sub
Private Sub Button1_Click
Dim rs As ResumableSub = GetQRC_Reader
Wait For (rs) Complete (Result As String)
Dim Resultado As String = Result
End Sub
Private Sub GetQRC_Reader As ResumableSub
Return QRC_Reader.Resultado
End Sub
Remember that that a call to Sleep or Wait For in a resumable sub causes the code flow to return to the parent. Example: Sub Button1_Click Sum(1, 2) Log("after sum") End Sub Sub Sum(a As Int, b As Int) Sleep(100) 'this will cause the code flow to return to the parent Log(a + b) End Sub...
Private Sub Button1_Click
Dim rs As ResumableSub = GetQRC_Reader
Wait For (rs) Complete (Result As String)
Dim Resultado As String = Result
End Sub
Private Sub GetQRC_Reader As ResumableSub
Return QRC_Reader.Resultado
End Sub
Remember that that a call to Sleep or Wait For in a resumable sub causes the code flow to return to the parent. Example: Sub Button1_Click Sum(1, 2) Log("after sum") End Sub Sub Sum(a As Int, b As Int) Sleep(100) 'this will cause the code flow to return to the parent Log(a + b) End Sub...