DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Evaluation a function

  1. #1
    Matthew Cromer Guest

    Evaluation a function


    I need to evaluate a function typed in by the user at runtime (actually read
    from a DB table, but you get the picture). I understand that this is possible
    using certain DLLs. Can someone give me a thirty-second synopsis of what
    I need to do?

    Thanks,

    Matthew Cromer

  2. #2
    Norm Cook Guest

    Re: Evaluation a function

    Hi Matthew, perhaps this will get you started. Put a Microsoft Script
    Control (MSSCRIPT.OCX) on a form

    Private Sub Form_Load()
    Dim a%, b%
    a = 2: b = 4
    Debug.Print ScriptControl1.Eval(a * b)
    End Sub
    HTH

    Matthew Cromer <matthew@sdaconsulting.com> wrote in message
    news:39099294$1@news.devx.com...
    >
    > I need to evaluate a function typed in by the user at runtime (actually

    read
    > from a DB table, but you get the picture). I understand that this is

    possible
    > using certain DLLs. Can someone give me a thirty-second synopsis of what
    > I need to do?
    >
    > Thanks,
    >
    > Matthew Cromer




  3. #3
    Matthew Cromer Guest

    Re: Evaluation a function


    "Norm Cook" <normarnet@arn.net> wrote:
    >Hi Matthew, perhaps this will get you started. Put a Microsoft Script
    >Control (MSSCRIPT.OCX) on a form
    >
    >Private Sub Form_Load()
    > Dim a%, b%
    > a = 2: b = 4
    > Debug.Print ScriptControl1.Eval(a * b)
    >End Sub
    >HTH


    Thanks Norm:

    In fact, you don't have to put anything on a form.

    This will also work:

    Public Sub TestScript

    Dim objScriptControl As ScriptControl

    Set objScriptControl = New ScriptControl
    With objScriptControl
    .Language = "VBScript"
    MsgBox .Eval("1 + 1 + 2")
    End With


    End Sub

  4. #4
    Eddie Burdak Guest

    Re: Evaluation a function

    Matthew,

    > I need to evaluate a function typed in by the user at runtime


    you could always try Balena's Runtime Evaluator VBPJ Feb '98 or try the
    locator code FB0298.

    I thought it was quite good actually.

    Eddie



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center