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/
>
>