Equator 1.00
By: Matthew Wells Date: 06/03/2000



113 KB

Download now!

In other version of Microsoft programming languages, there is an Eval function to evaluate an expression automatically. That function is mysteriously missing in VB. So, if you want to evaluate (calculate) the result of a string expression, you have to use an OCX control.

The Equator control is very easy to use and supports all basical operations. Simply feed it a string expression, invoke the Calculate method and an answer appears almost instantly. Basic arithmetic operations are allowed, as well as exponents, parentheses and negative numbers. The correct order of operations is always observed. Complete VB source code is also provided.

Property Desription
Equation Use this property to set the expression to solve
LastSolved Keeps track of the last solved expression
Result This property will contain the result at the end of the operation
SolveError If there are errors, read this property to know why
Solving Boolean property. Is set to True during calculations

Method Desription
Calculate Invoke this method to solve the expression contained in the Equation property

Below is some sample VB code that solves an equation and
retrieves the solution:

Dim answer As Double
Equator1.Equation = "(4+2)*8/2"
answer = Equator1.Result

Equator1 is the name of the Equator control.

To install, run the executable file you downloaded. In VB, go to Project>Components, click Browse, and select the file EquatorV1. The control should then be available from your toolbox. Remember that it is not visible at runtime.
In the installed folder, you can find a readme file and the complete source code for the control.

Click Here!

Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
To contact the Webmaster, click here.
Hosted by InWind: www.inwind.it