Help finding conditional expression interpreter

Discussion in 'ASP.NET / ASP.NET Core' started by cragi, Jun 26, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I've tried googling "vbscript conditional expression interpreter" with no luck. I'm sure better places to look for help than this forum..so if someone could tell me where it would be useful...

    I'm developing a database solution where I need to store strings of conditional expressions:
    (Var1&&Var2)||Var3>=54.783
    or
    Var1+Var2*Var3......etc

    basically I need to verify the strings to be legitimate conditional expressions (format unimportant) and then to actually run the expressions in vbscript when I retrieve them. I could spend a lot of time writing this code myself, but I'm guessing there has to be something out there already. Only I need helping finding it - can someone point me in the right direction.
     
  2. The point...is that the code would be almost identical niVB.NET... you can use VB.NET in your code instead of C#. You will have the entire VB.NET compiler at your disposal rather than just VBScript.

    Maybe that's too much power.

    Perhaps you want the old "Windows Script Components"? Is that still installed in Windwows Server 2003 which is what I think DASP runs here? I don't know. It might not be installed on future version of Windows. You are better off using VB.NET to be more compatible with the future.

    Please have a look at the article I suggested and do the search I suggested and you will find that the VB.NET compiler gives you all the tools you need.
     
  3. The following link has a translator to convert C# to VB:
    http://authors.aspalliance.com/aldotnet/examples/translate.aspx

    You just drop the C# code to be translated (without <script> </script> tags into a text box, click the Translate button and you get a VB version of the C# code that you can cut and paste into your own application. The translator will flag anything it does not know how to translate.

    This may be of help to you.
     
  4. quote:Originally posted by diltonm

    www.codeproject.com

    Search in articles for "Runtime C# expression Evaluator".

    HTH

    </blockquote id="quote"></font id="quote">
    Appreciate the help, but I've never used C#...I'm trying to develop this with VBscript again. An alternative name would be "logical expression" or "mathematical expression" even....
     
  5. Maybe I'm misunderstanding you or vice versa. I checked out the link it offers a way of converting C# to VBscript I believe.

    What I'm trying to do is allow users to type in mathematical and logical expressions (A+B*C), then in my code, read them in as strings and interpret them. The code would parse the string based on the operators ("+" and "*") and perform the necessary evaluation of the arbitrary strings....

    This way, user A could type in a string, say simply A+B*C...and I would store the formula into memory...
    User B would fill out:
    A=5
    B=2
    C=8
    This would plug into user A's formula to come up with 5+2*8=80

    I'm looking more for logical expression, not simple math expressions, but this is the basic concept of what I'm trying to do...
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page