Quick Search for:  in language:    
HERE,Ever,wanted,program,will,calculate,value
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,014,970. lines
 Jobs: 119. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
Click here to see a screenshot of this code!MSChart Simple Example
By Sebastian Pereira on 7/2

(Screen Shot)

CString v1.5
By Ultimatum on 7/2


Tablature Pro
By Michael McMullen on 7/2


Click here to see a screenshot of this code!MSN Password Decryptor
By Muhammad Sufyan Ansari on 7/2

(Screen Shot)

Mp3 Paker
By Michael McMullen on 7/2


Suppress Run Time Script Errors
By Nuclear_1000G on 7/2


Click here to see a screenshot of this code!List Maker
By KBM-00 on 7/1

(Screen Shot)

Web Update Checker
By knormalnight on 7/1


A*Beginners API*
By Michael Nipper on 7/1


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Expression Evaluator (that is - STRING CALCULATOR)

Print
Email
 
winzip icon
Submitted on: 12/13/1999
By: Konstantin Tretyakov  
Level: Advanced
User Rating: By 3 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 6332 times.
 
(About the author)
 
     Ever wanted to have a program, that will calculate the value of a given expression? (like you give it "2*3^sin(2)+23/(2*Abs(-8.5)" and it returns the value). Well HERE IT IS - My 'EVALUATOR' class. You may search all over, noone will give you such source (at least I didn't find). :) ('Eat MY code...':) ---Also, read the README.TXT File in the Zip. Thanx!
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 13 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
12/14/1999 8:52:19 AM:Robert
mvervi, this would be good if you 
distributed a program to a user that 
did not have Excel.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/14/1999 11:59:10 AM:Bart Hermans
Thank you very very much man!!! I've 
been working on such a class for a very 
long time now, and I must say it isn't 
easy!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/14/1999 1:23:45 PM:Konstantin
mvervi, I don't understand this 
logic.
1) I made this for the 
ALGORITHM itself.
2) Excel loads for 
hours...(and costs much)
3) Besides, 
if you make a calculator app, I will 
ask you: "Why do you make it - there is 
one in Windows" ,and so with nearly 
every program...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/15/1999 3:28:51 AM:Javier Martin
Hi Konstantin, Very good work!
mvervi, 
there are so much applications where is 
absolutely mandatory to have modules 
like this ...
Javier 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/15/1999 7:06:08 PM:Reb
Great job! Makes it very easy to write 
a scripting language. This is the most 
useful code I've seen in awhile.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/2/2000 2:08:39 AM:Kevino
I also submitted an expression parser a 
while back, if anyone is interested in 
this.  Just do a search for "3D 
Mathematical Plot".  I have an equation 
solver to go along with it.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/5/2000 4:52:49 PM:Philip Leitch
Cool code... just one little fixer 
upper, in the function CalcFunction, PI 
is stated as a number (because VB does 
not have a PI constant).  However, it 
can be acurately calculated by using 
the arc tangent (so I am a maths buff). 
 So, it should read:
        Case 
"PI"
            CalcFunction = 4 * 
Atn(1)
Cheers.... and again, cool code.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/5/2000 5:25:22 PM:Konstantin Tretyakov
Yeah, right, from the point of math it 
is cool to calculate the PI from ATN, 
but from the point of programming it 
will be better not to make the 
calculation. PI is a constant and (if 
I'm not mistaken) I gave it with the 
best precision VB can handle.
If it 
is not enough: PI=3.14159 26535 89793 
23846 26433 83279 50288 41971 69399 
37510 58209 74944 59230 78164 06286 
20899 86280 34825 34211 70679...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/10/2000 12:59:50 PM:Jason
Cool Code Konstantin,
   This is 
just what I was looking for.
Jason.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/17/2000 6:29:00 PM:Brian
One problem: try this -2^2 gives -4; it 
should give 4
-2^2 = -2*-2 = 4
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/17/2000 7:26:46 PM:kt
Brian, that's not a problem, everything 
is correct here. (-2)^2 is 4, but 
-2^2=-(2^2)=-4.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/25/2000 9:04:50 PM:Vanessa
This code is great.  I have been trying 
to find something that will convert 
text formulas into a result and this 
does it just fine.  Had found others, 
but they didn't handle brackets.  
Thanks for this, it will save me a lot 
of time.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/11/2001 11:47:11 AM:Mark Hunter
Great code!  Truly useful.
One 
suggestion for enhancement would be to 
evaluate expressions 
like:
3x^2+2x
This can be done 
with the current class only with the 
syntax:
3*x^2+2*x
Which might not 
be immediately intuitive.  Maybe the 
class could add the "*" automatically 
when necessary.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/30/2002 5:36:17 PM:David
Exactly what I was looking for! Great 
job, Konstantin!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/28/2003 12:11:30 AM:
Thank you, I have been lokking for some 
code like this for a long time, but 
none of the modules I tried worked. 
However, I was wondering if their is 
some way to put the result into a text 
box instead of in a msgbox.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.