注意该函数的参数名为strToothpaste。调用该函数时,传入的变量使用相同的名称。
Private Sub DoThis()
Dim strToothpaste as String
Dim booSmellsFunny as Boolean
booSmellsFunny = fnc_Fragrance(strToothpaste)
End Sub
--------------------------
Private Function fnc_Fragrance(strToothpaste As String) as Boolean
If strToothpaste Like "Dr Watson's" Then
fnc_Fragrance = True
Else
fnc_Fragrance = False
End If
End Function
答案 0 :(得分:4)
希望这有帮助。