PC Review


Reply
Thread Tools Rate Thread

what calculate the formula?

 
 
VladimirT
Guest
Posts: n/a
 
      26th Nov 2004
I have TextBox in him User enters the formula for instance Cos(x) what
compute in code of the program?

she is got text ((

many thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5hbmRbTVZQXQ==?=
Guest
Posts: n/a
 
      26th Nov 2004
I assume you want to do evaluation of formulas in your program. There are a
few options avbl. One is to write your own evaluation using postfix algo.
This will work fine if you have a small set of functions you want to
evaluate. The other maybe to use reflection.emit to generate code for the
expression and execute it at runtime.

Rgds,
Anand M
VB.NET MVP
http://www.dotnetindia.com

"VladimirT" wrote:

> I have TextBox in him User enters the formula for instance Cos(x) what
> compute in code of the program?
>
> she is got text ((
>
> many thanks
>
>
>

 
Reply With Quote
 
VladimirT
Guest
Posts: n/a
 
      26th Nov 2004
melt example of the code or URL please

"Anand[MVP]" <(E-Mail Removed)> сообщил/сообщила в
новостях следующее:
news:C1CCD450-4D53-4667-9249-(E-Mail Removed)...
> I assume you want to do evaluation of formulas in your program. There are

a
> few options avbl. One is to write your own evaluation using postfix algo.
> This will work fine if you have a small set of functions you want to
> evaluate. The other maybe to use reflection.emit to generate code for the
> expression and execute it at runtime.
>
> Rgds,
> Anand M
> VB.NET MVP
> http://www.dotnetindia.com
>
> "VladimirT" wrote:
>
> > I have TextBox in him User enters the formula for instance Cos(x) what
> > compute in code of the program?
> >
> > she is got text ((
> >
> > many thanks
> >
> >
> >



 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      26th Nov 2004
"VladimirT" <(E-Mail Removed)> wrote in news:#jFKNp30EHA.1204
@TK2MSFTNGP10.phx.gbl:

> I have TextBox in him User enters the formula for instance Cos(x) what
> compute in code of the program?
>
> she is got text ((
>
> many thanks



What you wrote doesn't make very much sense...

But you can go:

txtBoxValue.text = Cstr(Cos(Cint(txtCos.text)))


--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
VladimirT
Guest
Posts: n/a
 
      26th Nov 2004
my code

Function FunctionEval(ByVal X As Double) As Double

Try

FunctionEval = Cos(X * 10)

'FunctionEval = txtFunction.Text?????? I want here to take from textbox as?

Catch exc As Exception

Console.WriteLine(exc.Message)

End Try

End Function

"VladimirT" <(E-Mail Removed)> сообщил/сообщила в новостях следующее:
news:(E-Mail Removed)...
> melt example of the code or URL please
>
> "Anand[MVP]" <(E-Mail Removed)> сообщил/сообщила в
> новостях следующее:
> news:C1CCD450-4D53-4667-9249-(E-Mail Removed)...
> > I assume you want to do evaluation of formulas in your program. There

are
> a
> > few options avbl. One is to write your own evaluation using postfix

algo.
> > This will work fine if you have a small set of functions you want to
> > evaluate. The other maybe to use reflection.emit to generate code for

the
> > expression and execute it at runtime.
> >
> > Rgds,
> > Anand M
> > VB.NET MVP
> > http://www.dotnetindia.com
> >
> > "VladimirT" wrote:
> >
> > > I have TextBox in him User enters the formula for instance Cos(x) what
> > > compute in code of the program?
> > >
> > > she is got text ((
> > >
> > > many thanks
> > >
> > >
> > >

>
>



 
Reply With Quote
 
VladimirT
Guest
Posts: n/a
 
      26th Nov 2004
my code

Function FunctionEval(ByVal X As Double) As Double

Try

FunctionEval = Cos(X * 10)

'FunctionEval = txtFunction.Text?????? I want here to take from textbox as?
I it is necessary for назных function sin,cos,tg,ctg



Catch exc As Exception

Console.WriteLine(exc.Message)

End Try

End Function


"Lucas Tam" <(E-Mail Removed)> сообщил/сообщила в новостях следующее:
news:Xns95AD10824C250nntprogerscom@140.99.99.130...
> "VladimirT" <(E-Mail Removed)> wrote in news:#jFKNp30EHA.1204
> @TK2MSFTNGP10.phx.gbl:
>
> > I have TextBox in him User enters the formula for instance Cos(x) what
> > compute in code of the program?
> >
> > she is got text ((
> >
> > many thanks

>
>
> What you wrote doesn't make very much sense...
>
> But you can go:
>
> txtBoxValue.text = Cstr(Cos(Cint(txtCos.text)))
>
>
> --
> Lucas Tam ((E-Mail Removed))
> Please delete "REMOVE" from the e-mail address when replying.
> http://members.ebay.com/aboutme/coolspot18/



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      26th Nov 2004
Vladimir,

Still not tried by me.

\\\Eval by Nigel Amstrong
1. Create a file called: DynamicMath.js
2. Add this code to it:

class DynamicMath
{
static function Eval(MathExpression : String) : double
{
return eval(MathExpression);

};
}
3. Compile it with the command line jsc compiler: jsc /t:library
DynamicMath.js
4. Add a reference to DynamicMath.dll to your project (and to
Microsoft.JScript.dll as well)
5. Use from your favourite .NET language:
Dim d As Double = DynamicMath.Eval("2 + 3 + 4")
MessageBox.Show(d)
6. That's it..
///

I hope this helps a little bit?

Cor

"VladimirT" <(E-Mail Removed)>

>
> Function FunctionEval(ByVal X As Double) As Double
>
> Try
>
> FunctionEval = Cos(X * 10)
>
> 'FunctionEval = txtFunction.Text?????? I want here to take from textbox
> as?
> I it is necessary for назных function sin,cos,tg,ctg
>
>
>
> Catch exc As Exception
>
> Console.WriteLine(exc.Message)
>
> End Try
>
> End Function
>
>
> "Lucas Tam" <(E-Mail Removed)> сообщил/сообщила в новостях следующее:
> news:Xns95AD10824C250nntprogerscom@140.99.99.130...
>> "VladimirT" <(E-Mail Removed)> wrote in news:#jFKNp30EHA.1204
>> @TK2MSFTNGP10.phx.gbl:
>>
>> > I have TextBox in him User enters the formula for instance Cos(x) what
>> > compute in code of the program?
>> >
>> > she is got text ((
>> >
>> > many thanks

>>
>>
>> What you wrote doesn't make very much sense...
>>
>> But you can go:
>>
>> txtBoxValue.text = Cstr(Cos(Cint(txtCos.text)))
>>
>>
>> --
>> Lucas Tam ((E-Mail Removed))
>> Please delete "REMOVE" from the e-mail address when replying.
>> http://members.ebay.com/aboutme/coolspot18/

>
>



 
Reply With Quote
 
VladimirT
Guest
Posts: n/a
 
      26th Nov 2004
can not create dll mistake heap (((

"Cor Ligthert" <(E-Mail Removed)> сообщил/сообщила в новостях
следующее: news:#(E-Mail Removed)...
> Vladimir,
>
> Still not tried by me.
>
> \\\Eval by Nigel Amstrong
> 1. Create a file called: DynamicMath.js
> 2. Add this code to it:
>
> class DynamicMath
> {
> static function Eval(MathExpression : String) : double
> {
> return eval(MathExpression);
>
> };
> }
> 3. Compile it with the command line jsc compiler: jsc /t:library
> DynamicMath.js
> 4. Add a reference to DynamicMath.dll to your project (and to
> Microsoft.JScript.dll as well)
> 5. Use from your favourite .NET language:
> Dim d As Double = DynamicMath.Eval("2 + 3 + 4")
> MessageBox.Show(d)
> 6. That's it..
> ///
>
> I hope this helps a little bit?
>
> Cor
>
> "VladimirT" <(E-Mail Removed)>
>
> >
> > Function FunctionEval(ByVal X As Double) As Double
> >
> > Try
> >
> > FunctionEval = Cos(X * 10)
> >
> > 'FunctionEval = txtFunction.Text?????? I want here to take from textbox
> > as?
> > I it is necessary for назных function sin,cos,tg,ctg
> >
> >
> >
> > Catch exc As Exception
> >
> > Console.WriteLine(exc.Message)
> >
> > End Try
> >
> > End Function
> >
> >
> > "Lucas Tam" <(E-Mail Removed)> сообщил/сообщила в новостях

следующее:
> > news:Xns95AD10824C250nntprogerscom@140.99.99.130...
> >> "VladimirT" <(E-Mail Removed)> wrote in news:#jFKNp30EHA.1204
> >> @TK2MSFTNGP10.phx.gbl:
> >>
> >> > I have TextBox in him User enters the formula for instance Cos(x)

what
> >> > compute in code of the program?
> >> >
> >> > she is got text ((
> >> >
> >> > many thanks
> >>
> >>
> >> What you wrote doesn't make very much sense...
> >>
> >> But you can go:
> >>
> >> txtBoxValue.text = Cstr(Cos(Cint(txtCos.text)))
> >>
> >>
> >> --
> >> Lucas Tam ((E-Mail Removed))
> >> Please delete "REMOVE" from the e-mail address when replying.
> >> http://members.ebay.com/aboutme/coolspot18/

> >
> >

>
>



 
Reply With Quote
 
Jan Karchnak
Guest
Posts: n/a
 
      27th Nov 2004
Try clsMathParser
http://digilander.libero.it/foxes/ma...ionsParser.htm

Jan



"VladimirT" <(E-Mail Removed)> pМ╧e v diskusnМm pЬМspЛvku
news:%(E-Mail Removed)...
>I have TextBox in him User enters the formula for instance Cos(x) what
> compute in code of the program?
>
> she is got text ((
>
> many thanks
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Worksheet Functions 1 13th Sep 2007 09:02 AM
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Programming 1 13th Sep 2007 09:02 AM
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Microsoft Excel Misc 1 13th Sep 2007 09:02 AM
Cannot Calculate the Formula Ellis Yu Microsoft Excel Misc 9 7th Apr 2004 12:34 PM
formula won't calculate scootr Microsoft Excel Worksheet Functions 1 9th Sep 2003 10:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 PM.