实现上述功能的VB代码如下,但加框处代码有错,请改正。
Dim g(100) As String, day(100) As Integer, xl(100) As String, pri(100)
As Integer
Const n=100
Private Sub Form_Load()
'从数据库中读取数据并存储在相关变量中。g()数组存储国内/国外,day()数组存储出游天数,xl()数组存储旅游线路名称,pri()数组存储行程报价。
'代码略
End sub
Private Sub Command1 Click()
Dim i As Integer,j As Integer
For i=I To n\2
For j=I To n-i
If pri(j)>pri(j+1) Then
t=pri(j): pri(j)=pri(j+1): pri(j+1)=t
End if
Next j
If pri(j)<pri(j-1) Then
t=pri(j): pri(j)=pri(j-1): pri(j-1)=t
End If
Next j
Next i
List1.Clear
i=1
Do While i<=n And g(i)=Text1.Text And day(i)=Val(Text2,Text)
i=i+1
Loop
End Sub
程序中加框代码应改为、。