gambas-source-code/app/examples/Misc/Evaluator/.src/FEval.class
Benoît Minisini c6a9cd69c2 [EXAMPLES]
* NEW: Add examples again. I hope correctly this time.


git-svn-id: svn://localhost/gambas/trunk@6726 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-12 19:58:52 +00:00

53 lines
785 B
Text

' Gambas class file
Private $hExpr As New Expression
Private $cEnv As New Collection
Static Public Sub Main()
Dim hForm As Form
hForm = New FEval
hForm.Show
End
Public Sub btnUpdate_Click()
Dim cCol As New Collection
If $hExpr.Text <> txtExpr.Text Then
$hExpr.Text = txtExpr.Text
Endif
'cEnv.Compare = gb.Case
$cEnv["a"] = CFloat(Val(txtValueA.Text))
$cEnv["b"] = CFloat(Val(txtValueB.Text))
$cEnv["x"] = CFloat(Val(txtValueX.Text))
$cEnv["y"] = CFloat(Val(txtValueY.Text))
$hExpr.Compile
$hExpr.Environment = $cEnv
txtResult.Text = Str($hExpr.Value)
Catch
txtResult.Text = Error.Text
End
Public Sub btnClose_Click()
Me.Close
End
Public Sub Form_Open()
txtValueA.Text = Str(0.5)
txtValueB.Text = Str(1)
End