EVAL is an expression evaluator library. It evaluates almost any Visual Basic expression. You can accept expressions from the users and calculate the result with a simple call. A few examples of what you application might do:
Calculae a simple mathematical formula like "1+2+3".
Accept any formula like "x + y^2", substitute variable values and get the result.
Draw curves from user-defined formulas.
Build your own calculator.
Add expressions to your own programming language or macro system.
Eval is simple to use. Here is an example.
Formula = Textbox.Text ' Accept input from the user, example: "1+2+3"
Result = Eval(Formula) ' Result will be 6
Supported expressions
Eval can handle all Visual Basic constant expressions:
Numbers (decimal, octal, hexa) and String literals
Numeric operators: all arithmetic, comparison and logical operators (+ - * / / ^ Mod, etc.)
String concatenation and Like
The keywords Empty and Null
Basic single-argument functions like CINT(), Abs() or Sgn()
Eval contains an easy interface to support variables. You can also extend the module by adding more functions.
Module information
Eval comes as an ordinary source code module (Eval.bas) for Visual Basic 5.0 and 6.0. There is also a version for VBCE 6.0. It doesn't require any specific Windows version or run-time files.
VB.NET support is currently not available. Eval is written in a way that is not easily upgraded to VB.NET.