Evaluation functions are ubiquitous in scripts but rare in compiled languages because it's far easir to carry out the evaluation of a string with an interpreter. This creates problems if you're writting an interactive application, particularly a mathematical one, as you're liable to want the user to enter equations, etc.

This class overcomes that problem by providing a method for a VB application to evaluate a string.

It's based on the published Microsoft code with additions to allow the recognition of more variables and functions.

The class is called eval which has a single method of the same name, eval.

The class recognises the variables a, b, c, d, l, m, x and y, (although only x is available in the demonstration), and the constants pi and e as well as the usual operators, trig. and inverse trig. functions, the hyperbolic functions, log2, (log2), and log10, (log10).

[Last update: 19/7/2014]