CodeItBetter Programming Another VB Programming Blog

How to evaluate Mathematical Expressions passed as a string

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
'Math - How to evaluate Mathematical Expressions passed as a string

Option Explicit
 
'Add Microsoft Script Control to your Form. (Project -> Components, Select the Microsoft Script Control)

Private Sub Main()
    MsgBox (ScriptControl1.Eval("(7 * 12) - 1"))
End Sub
Filed under: Math Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.