Hi everyone.
Is there a better way to write the code below?
The above code repeats for each menu option, always creating a class whose name matches the menu name
Is there a better way to write the code below?
B4X:
Sub MenuBar1_Action
Dim mi As MenuItem = Sender
If mi.Text = "Users" Then
Dim us As Users ' general class
us.Initialize
End If
If mi.Text = "Unity" Then
Dim un As Unity
un.Initialize
End If
End Sub
The above code repeats for each menu option, always creating a class whose name matches the menu name