G GaNdAlF89 Active Member Licensed User Longtime User Mar 2, 2021 #1 Hi to all! I need to connect to a bluetooth printer with Serial library, and I need a MsgboxAsync inside the "BTSerialPrinter_Connected (Success as Boolean)" event, when Success=False. How can I do to make "As Resumable" the _Connected event? Thank you. Current code: B4X: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) End Sub Sub BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) 'etc End Sub
Hi to all! I need to connect to a bluetooth printer with Serial library, and I need a MsgboxAsync inside the "BTSerialPrinter_Connected (Success as Boolean)" event, when Success=False. How can I do to make "As Resumable" the _Connected event? Thank you. Current code: B4X: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) End Sub Sub BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) 'etc End Sub
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2021 #2 Code: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) Wait For BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) End If End Sub Upvote 0
Code: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) Wait For BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) End If End Sub
G GaNdAlF89 Active Member Licensed User Longtime User Mar 2, 2021 #3 Erel said: Code: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) Wait For BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) End If End Sub Click to expand... Thanks, now I understood the logic. Sorry for misunderstanding. Upvote 0
Erel said: Code: Sub BTPrinterConnect BTSerialPrinter.Connect(params...) Wait For BTSerialPrinter_Connected (Success As Boolean) If Success = False Then MsgboxAsync("Connecting error...","Attention") Wait For Msgbox_Result (res As Int) End If End Sub Click to expand... Thanks, now I understood the logic. Sorry for misunderstanding.