Jul 19th, 2006, 11:42 AM
#1
Thread Starter
New Member
Calculation on a string
I have to display te resul of a simple math operation entered as string
example
input="22+2*3"
output display=28
Anybody knows how
Jul 19th, 2006, 11:53 AM
#2
Re: Calculation on a string
you could parse it manually, or
you could add a Microsoft Script Control to your form and then just do:
VB Code:
MsgBox ScriptControl1.Eval("22+2*3")
Jul 19th, 2006, 12:05 PM
#3
Thread Starter
New Member
Re: Calculation on a string
the problem is it needs to be display as a object in the form
Jul 19th, 2006, 12:08 PM
#4
Re: Calculation on a string
eh? the control just does he calculating, you can assign to result to whatever you like:
VB Code:
Label1.Caption = ScriptControl1.Eval("22+2*3")
Jul 19th, 2006, 02:09 PM
#5
Hyperactive Member
Re: Calculation on a string
hi Check the zip I included it do what you want without depending on other control all code commeneted, supports all Math operators variables brackets, Functions and more.
Attached Files
When your dreams come true.
On error resume pulling hair out.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width