Dim n As Integer '总人数
Dim dq(1 To 2000) As String
Dim xm(1 To 2000) As String
Dim tw(1 To 2000) As Single
Dim city(1 To 100) As String
Dim citynum(1 To 100) As Integer
Dim citys As Integer
Private Sub Form_ Load()
'该过程的作用从数据库读取n个患者的信息,并在列表框List1输出所有患者的地区、姓名、体温信息。
'dq数组存储患者的地区信息
'xm数组存储患者的姓名信息
'tw数组存储患者的体温信息
'代码略
End Sub
Private Sub Command1_Click()
Dim i, j As Integer
Dim s As String, t As Integer
citys=0
For i=1 To n
If tw(i)>>=37.4 Then
For j = 1 To citys
If Then citynum(j) = citynum(j) +1: Exit For
Next j
If j> citys Then citys = citys +1: city(citys) = dq(i) : citynum(citys) = 1
End If
Next i
For i=1 To citys-1
For j = citys Toi + 1 Step -1
If Then
s = city(j): city(j) = city(i): city(i) = s
t = citynum(j): citynum(j) = citynum(i): citynum(i) = t
End If
Next j
Next i
For i=1 To citys
List2. AddItem city(i)+" "+Str( citynum(i))
Next i
End Sub
Private Sub Command2_ Click( )
Dimi, j As Integer
For
For j=1 To n
If dq(j) = city(i) And tw(j) >= 37.4 Then
List3. AddItem dq(j) + ""+ xm(j) + ""+ Str(tw(j))
End If
Next j
Next i
End Sub