在VB里怎样实现
Dim str As String
str = "1>0"
If str Then
MsgBox str
End If
''''''''''
private function GetStr(...)
.......
end func
因为,这个str我想要用一个函数返回判断的串,避免在每个程序段里面写这个str,提高点程序的质量.
但是,为什么VB就不行呢?
有别的办法实现吗?
Dim str As String
str = "1>0"
If str Then
MsgBox str
End If
''''''''''
private function GetStr(...)
.......
end func
因为,这个str我想要用一个函数返回判断的串,避免在每个程序段里面写这个str,提高点程序的质量.
但是,为什么VB就不行呢?
有别的办法实现吗?
Private Sub Command1_Click()
Dim str As String
str = 1 > 0
If CBool(str) Then
MsgBox str
End If
End Sub
Private Sub Command1_Click()
Dim mm As String
mm = "20>30"
If ScriptControl1.Eval(mm) Then
txtoutput.Text = "True"
Else
txtoutput.Text = "False"
End If
End Sub
private function GetStr(ss as string) as boolean
if ss=?XX then '等於什麼值時,返回真
getstr=true
end if if ss=?YY then '等於什麼值時,返回假
getstr=false
end if
end func