Wish chinese can not be contained(embodyed) in the name of sub

acj200301

Member
hellow ,erel ,

chinese can not be contained(embodyed) in the name of sub ,

b4a has not this function , or i have not find it ?

thank you ,
 

acj200301

Member
thanks , now , name of variable can be chinese ,

if The sub name and other identifier names can be chinese characters in the future , it will be great ,

the code will be more readable ,
 

aeric

Expert
Licensed User
Longtime User
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
 

Sandman

Expert
Licensed User
Longtime User
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 is a joke.)
 
Top