-
Notifications
You must be signed in to change notification settings - Fork 0
/
Evaluate.frm
273 lines (265 loc) · 8.32 KB
/
Evaluate.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
VERSION 5.00
Begin VB.Form frmEval
BorderStyle = 1 'Fixed Single
Caption = "Evaluator! Write to Wolf at wolf_knight_x@yahoo.com!"
ClientHeight = 1845
ClientLeft = 3180
ClientTop = 4065
ClientWidth = 6765
BeginProperty Font
Name = "Lucida Sans Unicode"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1845
ScaleWidth = 6765
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdExit
Caption = "Exit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4320
TabIndex = 8
Top = 960
Width = 1215
End
Begin VB.CheckBox Check1
Caption = "Error Diagnostics"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 2
ToolTipText = "Error Suppressor On/Off"
Top = 240
Value = 1 'Checked
Width = 1815
End
Begin VB.Frame Frame1
Caption = "Options"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 0
TabIndex = 5
Top = 0
Width = 2775
Begin VB.Frame Frame2
Caption = "Constants"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 7
Top = 1080
Width = 2295
Begin VB.TextBox txtVal1
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1200
TabIndex = 11
Text = "10"
Top = 240
Width = 735
End
Begin VB.TextBox txtConst1
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
TabIndex = 9
Text = "a"
Top = 240
Width = 735
End
Begin VB.Label lblEq
Caption = "="
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 960
TabIndex = 10
Top = 240
Width = 495
End
End
Begin VB.CheckBox Check2
Caption = "Constant"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 6
Top = 720
Width = 1455
End
End
Begin VB.ListBox List1
BackColor = &H00800000&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 7665
Left = 9240
TabIndex = 3
TabStop = 0 'False
Top = 8280
Width = 9255
End
Begin VB.CommandButton cmdEnter
Caption = "Eval"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2880
TabIndex = 1
Top = 960
Width = 1215
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2880
TabIndex = 0
Text = "(2+3)*2"
Top = 0
Width = 3855
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00800000&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 495
Left = 2880
TabIndex = 4
Top = 360
Width = 3855
WordWrap = -1 'True
End
End
Attribute VB_Name = "frmEval"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdEnter_Click()
Dim equ As String
Dim op As String
Dim vars As Variant
Dim vals As Variant
Dim i As String
If Check2.value = 1 Then
vars = Array(txtConst1.Text)
vals = Array(txtVal1.Text)
End If
equ = Text1.Text
If Check1.value = 1 Then
equ = Evaluate(equ, False, vars, vals)
Else
equ = Evaluate(equ, True, vars, vals)
End If
Label1.Caption = Text1.Text & "=" & equ
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then cmdEnter_Click
End Sub