Results 1 to 1 of 1

Thread: Evaluate a string expression like a math function

  1. #1

    Thread Starter
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Evaluate a string expression like a math function

    Just add a textbox (txtEval), a command button (cmdEval), a reference to the Microsoft Script Control 1.0 and here you go :

    VB Code:
    1. Private Sub cmdEval_Click()
    2.     Dim objSC As New MSScriptControl.ScriptControl
    3.    
    4.     objSC.Language = "javascript"
    5.    
    6.     MsgBox objSC.Eval(txtEval.Text)
    7. End Sub
    Last edited by manavo11; Aug 26th, 2005 at 07:02 AM. Reason: Added the reference part


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width