I have a common sub routine that operates on 2 different pages, how do I send the page information to the sub?
I am currently using a string to hold the sender page then use SELECT to work out which page to operate on, this works but is messy, I am sure that there is a cleaner way. Can anyone help?
B4X:
Public Sub TestSub(senderpage As String)
Select senderpage
Case "STOCK_LOCATE"
B4XPages.MainPage.Page_STOCK_LOCATE.LblPartDescription.Text = "Part number not found"
Case "STOCK_OUT"
B4XPages.MainPage.Page_STOCK_OUT.LblPartDescription.Text = "Part number not found"
End Select
End Sub
You can pass the label directly as suggested above. What I meant, is that you will add a "SetDescription" sub in each of the pages and call it with CallSub.