字符串作数学运算

Private Sub Form_Load()
Dim sc As Object
Set sc = CreateObject("ScriptControl")

sc.Language = "VBScript"

S = sc.Eval("123 + 4")'或S = sc.Eval("123" & "+" & "4")
MsgBox S
End Sub

转载于:https://www.cnblogs.com/lbnnbs/p/4784823.html

你可能感兴趣的:(字符串作数学运算)