'求表达式的值
Function erresult(ByVal expression As String, ByVal x As String) As Single
Dim tmpStr As String
tmpStr = Replace(UCase(expression), "LN", "Log")
tmpStr = Replace(tmpStr, "X", x)
Dim OBJ As Object
Set OBJ = CreateObject("MSScriptControl.ScriptControl")
OBJ.Language = "vbscript"
erresult = OBJ.Eval(tmpStr)
Set OBJ = Nothing
End Function
'小数点后保留四位
Function yxw(ByVal b As Single) As Single
yxw = CSng(Fix(b * 10000) / 10000)
End Function
Public Function fmin(ByVal f As String, ByVal a1 As String, ByVal a2 As String, ByVal a3 As String) As String
Const e = 0.01
Dim a4 As String
Dim c1, c2 As Single
Dim f1, f2, f3, f4 As Single
Dim flag As Integer
f1 = erresult(f, a1)
Function erresult(ByVal expression As String, ByVal x As String) As Single
Dim tmpStr As String
tmpStr = Replace(UCase(expression), "LN", "Log")
tmpStr = Replace(tmpStr, "X", x)
Dim OBJ As Object
Set OBJ = CreateObject("MSScriptControl.ScriptControl")
OBJ.Language = "vbscript"
erresult = OBJ.Eval(tmpStr)
Set OBJ = Nothing
End Function
'小数点后保留四位
Function yxw(ByVal b As Single) As Single
yxw = CSng(Fix(b * 10000) / 10000)
End Function
Public Function fmin(ByVal f As String, ByVal a1 As String, ByVal a2 As String, ByVal a3 As String) As String
Const e = 0.01
Dim a4 As String
Dim c1, c2 As Single
Dim f1, f2, f3, f4 As Single
Dim flag As Integer
f1 = erresult(f, a1)