Depends on personal programming style. Maybe someone would feel more comfortable with following style.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Func("储存")
Func("删除")
Func("打印")
End Sub
Sub Func (FunctionName As String)
Select Case FunctionName
Case "储存"
BtnSave_Click
Case "删除"
BtnDelete_Click
Case "打印"
BtnPrint_Click
End Select
End Sub
Private Sub BtnSave_Click
Log("调用'储存'函数")
End Sub
Private Sub BtnPrint_Click
Log("调用'打印'函数")
End Sub
Private Sub BtnDelete_Click
Log("调用'删除'函数")
End Sub
Depends on personal programming style. Maybe someone would feel more comfortable with following style.
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("?")
✋("储存")
✋("删除")
✋("打印")
End Sub
Sub ✋(? As String)
Select Case ?
Case "储存"
Btn?_Click
Case "删除"
Btn⌫_Click
Case "打印"
Btn?_Click
End Select
End Sub
Private Sub Btn?_Click
Log("调用'储存'函数")
End Sub
Private Sub Btn?_Click
Log("调用'打印'函数")
End Sub
Private Sub Btn⌫_Click
Log("调用'删除'函数")
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.