Evaluate string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. van Herten

    #1

    Evaluate string

    I am searching for the replacement of the scriptcontrol of VB6 in .NET.
    I am plaing with the CodeDOM but I cannot get to evaluate a string text to
    the result I want.

    String text = "1 + 2"
    Result shoul be 3.


  • Chris R. Timmons

    #2
    Re: Evaluate string

    "J. van Herten" <kjhkjhzsdfg@hj klfio8uaysdf.nh akjsh> wrote in
    news:eYtgA0PTDH A.3796@tk2msftn gp13.phx.gbl:
    [color=blue]
    > I am searching for the replacement of the scriptcontrol of VB6
    > in .NET. I am plaing with the CodeDOM but I cannot get to
    > evaluate a string text to the result I want.
    >
    > String text = "1 + 2"
    > Result shoul be 3.[/color]

    For simple math expressions, you can use JScript.Net's Eval()
    function. It may be easiest to write a small assembly in JScript.Net
    that exposes a method that calls Eval(), and use that assembly in
    your C# or VB.Net app.

    Hope this helps.

    Chris.
    -------------
    C.R. Timmons Consulting, Inc.

    Comment

    • MikeB

      #3
      Re: Evaluate string

      See


      "J. van Herten" <kjhkjhzsdfg@hj klfio8uaysdf.nh akjsh> wrote in message
      news:##OecTTTDH A.1688@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Is it possible to use the VB language instead of the J#??
      >
      > "Chris R. Timmons" <crtimmons@X_NO SPAM_Xcrtimmons inc.com> wrote in message
      > news:Xns93BC3FD FD2D76crtimmons crtimmonsin@207 .46.248.16...[color=green]
      > > "J. van Herten" <kjhkjhzsdfg@hj klfio8uaysdf.nh akjsh> wrote in
      > > news:eYtgA0PTDH A.3796@tk2msftn gp13.phx.gbl:
      > >[color=darkred]
      > > > I am searching for the replacement of the scriptcontrol of VB6
      > > > in .NET. I am plaing with the CodeDOM but I cannot get to
      > > > evaluate a string text to the result I want.
      > > >
      > > > String text = "1 + 2"
      > > > Result shoul be 3.[/color]
      > >
      > > For simple math expressions, you can use JScript.Net's Eval()
      > > function. It may be easiest to write a small assembly in JScript.Net
      > > that exposes a method that calls Eval(), and use that assembly in
      > > your C# or VB.Net app.
      > >
      > > Hope this helps.
      > >
      > > Chris.
      > > -------------
      > > C.R. Timmons Consulting, Inc.
      > > http://www.crtimmonsinc.com/[/color]
      >
      >[/color]

      --
      MikeB


      Comment

      Working...