VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Evaluate

by Maseraj (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

Takes a string and evaluates it, thus giving the user an answer to a string such as "hsin(1)+hcos(1)", which will be e. The evaluator incorporates an error handler, as well as user entered constants. The function is in the module, easily made to be imported to other programs. A demonstration program is included an shows some possiblities. A help file is not included, but will be available by e-mail. An important point, to keep in mind, that almost all functions must be entered in form of sin(45). If a function has one argument, enter it like sin(45), otherwise, put first argument, function, second argument, as in 2+1.

Inputs
The user inputs are minimum. The user only has to enter the string. Optional arguments are to enable/disable the error handler, and include user-created constants.
Assumes
Those that use TI graphing calculators will remember the way functions are used. To enter square root of nine, put in sqr(9). Sine of 45 is sin(45), and so on, with some exceptions. Standard two-argrument operants like +, are entered just like that, 2+4.
Code Returns
Returns the value of the string, and any errors. Depending on whether the error handler is enabled or not, a message box may pop up.
Side Effects
Error handler is not fully functional. That means that it doesn't give back very good responses. At this point, though, it will detect any error. No crashes were detected in the testing period of over eight weeks.

Rate Evaluate

Download Evaluate

Download Evaluate (10 KB)

Evaluate Comments

No comments have been posted about Evaluate. Why not be the first to post a comment about Evaluate.

Post your comment

Subject:
Message:
0/1000 characters