📄 eval.frm
字号:
VERSION 5.00
Object = "*\A..\SOURCE\FAST2002.vbp"
Begin VB.Form frmEvaluator
BorderStyle = 3 'Fixed Dialog
Caption = "Math Evaluator"
ClientHeight = 1845
ClientLeft = 2445
ClientTop = 2805
ClientWidth = 5940
ClipControls = 0 'False
Icon = "Eval.frx":0000
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 1845
ScaleWidth = 5940
Begin VB.TextBox txtExpression
Height = 825
Left = 120
MultiLine = -1 'True
TabIndex = 1
Top = 360
Width = 5700
End
Begin VB.CommandButton cmdEvaluate
Caption = "&Calc"
Default = -1 'True
Height = 375
Left = 4725
TabIndex = 3
Top = 1350
Width = 1095
End
Begin FLWGraphMath.FWSolver objSolver
Left = 3675
Top = 1305
_ExtentX = 820
_ExtentY = 820
End
Begin VB.Label lblResult
AutoSize = -1 'True
Caption = "0"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000002&
Height = 240
Left = 915
TabIndex = 4
Top = 1395
Width = 135
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Result:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 135
TabIndex = 2
Top = 1395
Width = 735
End
Begin VB.Label lblLabel
Caption = "Expression"
Height = 255
Index = 0
Left = 120
TabIndex = 0
Top = 120
Width = 1935
End
End
Attribute VB_Name = "frmEvaluator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdEvaluate_Click()
objSolver.Expression = txtExpression
If objSolver.Solve Then
lblResult = objSolver.Solution
Else
lblResult = "Error"
Call MsgBox(objSolver.GetErrorDescription, _
vbOKOnly, "Error " & objSolver.GetError)
End If
End Sub
Private Sub Form_Load()
objSolver.Symbol("one") = 1
txtExpression = "( MyFunc(1 + 2, 2) * one + sin(PI) )"
End Sub
Private Sub objSolver_UserFunction(ByVal strFunction As String, ByVal cllParameters As Collection, vntReturnValue As Variant, blnProcessed As Boolean)
If strFunction = "MYFUNC" Then
If cllParameters.Count = 2 Then
blnProcessed = True
vntReturnValue = cllParameters(1) * cllParameters(2)
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -