I am calling a sub called ShowDialog from multiple places in code. Message1 is string Variable.
Intended outcome:
My code should display Dialog and wait for either ok or cancel.
Current scenario:
Dialog is shown but code moves on to Additional Code
Would be really nice if anyone can share or point out a more optimal way to reorganizing this to achieve intended outcome.
Intended outcome:
My code should display Dialog and wait for either ok or cancel.
Current scenario:
Dialog is shown but code moves on to Additional Code
Would be really nice if anyone can share or point out a more optimal way to reorganizing this to achieve intended outcome.
B4X:
Sub ShowDialog as Resumablesub
'Some code related to dialog
dlg.Title = "Warning !" 'dlg is B4XDialog
Dim sf As Object = dlg.Show(Message1, "OK", "", "CANCEL") 'Message1 is global string variable
CliptoOutline(dlg.Base,10dip)
Wait For (sf) Complete (Result As Int)
Return Result
End Sub
Sub callingSub
' Some Code
...
Wait For (ShowDialog) complete (result As Int)
If result = xui.DialogResponse_Cancel Then
'Do something
Else
'Do something else
End If
' Additional Code Continues