-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathForm1.frm
283 lines (253 loc) · 7.24 KB
/
Form1.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
274
275
276
277
278
279
280
281
282
283
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "C语言函数查询 - 计算机协会技术部"
ClientHeight = 5970
ClientLeft = 5625
ClientTop = 3360
ClientWidth = 8040
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5970
ScaleWidth = 8040
Begin VB.Frame Frame2
Caption = "函数"
Height = 5655
Left = 3120
TabIndex = 4
Top = 120
Width = 4815
Begin VB.TextBox sl
Height = 3255
Left = 720
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 12
Top = 2280
Width = 3975
End
Begin VB.TextBox yf
Height = 1095
Left = 720
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 10
Top = 1080
Width = 3975
End
Begin VB.TextBox gn
Height = 375
Left = 720
Locked = -1 'True
TabIndex = 8
Top = 600
Width = 3975
End
Begin VB.TextBox hsm
Height = 270
Left = 720
Locked = -1 'True
TabIndex = 6
Top = 240
Width = 3975
End
Begin VB.Label Label4
Caption = "示 例"
Height = 255
Left = 120
TabIndex = 11
Top = 2280
Width = 495
End
Begin VB.Label Label3
Caption = "用 法"
Height = 255
Left = 120
TabIndex = 9
Top = 1080
Width = 495
End
Begin VB.Label Label2
Caption = "功 能"
Height = 255
Left = 120
TabIndex = 7
Top = 600
Width = 495
End
Begin VB.Label Label1
Caption = "函数名"
Height = 255
Left = 120
TabIndex = 5
Top = 240
Width = 615
End
End
Begin VB.ListBox List1
Height = 4380
Left = 120
TabIndex = 2
Top = 1440
Width = 2895
End
Begin VB.Frame Frame1
Caption = "查询"
Height = 1095
Left = 120
TabIndex = 3
Top = 120
Width = 2895
Begin VB.TextBox txtDescribe
Height = 270
Left = 720
TabIndex = 1
ToolTipText = "回车搜索"
Top = 600
Width = 1935
End
Begin VB.TextBox txtFuncName
Height = 270
Left = 720
TabIndex = 0
Top = 240
Width = 1935
End
Begin VB.Label Label6
Caption = "功 能"
Height = 255
Left = 120
TabIndex = 14
Top = 600
Width = 615
End
Begin VB.Label Label5
Caption = "函数名"
Height = 255
Left = 120
TabIndex = 13
Top = 240
Width = 615
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public db As New SunSoft.AdodbHelper
Dim res As ADODB.Recordset
Function CNull(ByVal sTxt As Variant) As String 'ok at 11-10-08
If IsNull(sTxt) = True Then
CNull = ""
Else
CNull = sTxt
End If
End Function
Function ReWind(ByVal inPutX As String)
ReWind = Replace(inPutX, "'", "''")
End Function
Private Sub Form_Load()
If Dir(App.Path & "\clanguage.mdb") = "" Then
Call OutputFileS(101, App.Path & "\clanguage.mdb")
End If
db.SetConnToFile App.Path & "\clanguage.mdb"
Call loadtolist
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Kill App.Path & "\clanguage.mdb"
End
End Sub
Private Sub List1_Click()
Dim st As String
If List1.ListCount = 0 Then Exit Sub
st = List1.List(List1.ListIndex)
Set res = db.ExecParamQuery("select * from functions where hsm = ?", st)
If res.RecordCount = 0 Then
db.ReleaseRecordset res
Exit Sub
End If
hsm.Text = res.Fields("hsm")
gn.Text = res.Fields("gn")
yf.Text = res.Fields("yf")
sl.Text = res.Fields("sl")
db.ReleaseRecordset res
End Sub
Function loadtolist()
Set res = db.ExecQuery("select distinct hsm from functions")
List1.Clear
If res.RecordCount = 0 Then
db.ReleaseRecordset res
Exit Function
End If
Do While Not res.EOF = True
List1.AddItem res.Fields("hsm")
res.MoveNext
Loop
db.ReleaseRecordset res
End Function
Private Sub txtFuncName_KeyUp(KeyCode As Integer, Shift As Integer)
List1.Clear
If txtFuncName.Text = "" Then
Call loadtolist
Exit Sub
End If
Set res = db.ExecParamQuery("select * from functions where hsm Like ?", ReWind(txtFuncName.Text) & "%")
If res.RecordCount = 0 Then
db.ReleaseRecordset res
Call clsme
Exit Sub
End If
Do While Not res.EOF
List1.AddItem res.Fields("hsm")
res.MoveNext
Loop
db.ReleaseRecordset res
List1.ListIndex = 0
End Sub
Private Sub txtDescribe_KeyPress(KeyAscii As Integer)
Dim pattern As String
If txtDescribe.Text = "" Then
If KeyAscii = 13 Then
List1.Clear
Call loadtolist
End If
Call clsme
Exit Sub
End If
If KeyAscii = 13 Then
pattern = "%" & ReWind(txtDescribe.Text) & "%"
List1.Clear
Set res = db.ExecParamQuery("select * from functions where gn Like ?", pattern)
If res.RecordCount = 0 Then
db.ReleaseRecordset res
Call clsme
Exit Sub
End If
Do While Not res.EOF
List1.AddItem res.Fields("hsm")
res.MoveNext
Loop
db.ReleaseRecordset res
List1.ListIndex = 0
End If
End Sub
Function clsme()
hsm.Text = ""
gn.Text = ""
yf.Text = ""
sl.Text = ""
End Function
Function OutputFileS(ByVal sId As Long, ByVal sFile As String)
Dim sTemp() As Byte
sTemp = LoadResData(sId, "CUSTOM")
Open sFile For Binary As #1
Put #1, , sTemp
Close #1
End Function