Function FunctionEval(By Val X As Double) As Double
Try
ScriptControl.E xecuteStatement ("X=" & X)
Console.WriteLi ne(ScriptContro l.Eval("Cos(X * 10)"))
Console.WriteLi ne(Cos(X * 10))
Catch exc As Exception
Throw New Exception("Can' t evaluate function at X=" & X)
End Try
yes certainly I have changed code
considers he ÐÒÁÉÌØÎÏ but stops on "END TRY" but gives error
An unhandled exception of type 'System.Excepti on' occurred in
WindowsApplicat ion1.exe
Additional information: Can't evaluate function at X=1,00167224080 268
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:#R******** ******@TK2MSFTN GP09.phx.gbl...
"VladimirT" <vt**@mail.ru > schrieb: in vba is used windows script control 1.0 for molded got from
txtFunction
as possible do this in vb.net?
thank you
I have written code but he does not work
Function FunctionEval(By Val X As Double) As Double
ScriptControl.E xecuteStatement ("X=" & X)
FunctionEval = ScriptControl.E val(txtFunction .Text)
End Function
What does not work? Are you sure added the reference to the script
control?
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>