Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim temp As person
Dim a(3) As person For i = 1 To 2
For j = i + 1 To 3
If a(j).name < a(i).name Then 提示我这句错误 说对象变量或with 未被设置
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next j
Next i
For i = 1 To 3
Set a(i) = New person a(i).name = "南砼公司" + CStr(i)
a(i).address = "湖滨北路" + CStr(i)
Grid1.Row = i
Grid1.Col = 0
Grid1.Text = CStr(i)
Grid1.Row = i
Grid1.Col = 1
Grid1.Text = a(i).name
Grid1.Row = i
Grid1.Col = 2
Grid1.Text = a(i).address
Next i
End Sub
Dim i As Integer
Dim j As Integer
Dim temp As person
Dim a(3) As person For i = 1 To 2
For j = i + 1 To 3
If a(j).name < a(i).name Then 提示我这句错误 说对象变量或with 未被设置
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next j
Next i
For i = 1 To 3
Set a(i) = New person a(i).name = "南砼公司" + CStr(i)
a(i).address = "湖滨北路" + CStr(i)
Grid1.Row = i
Grid1.Col = 0
Grid1.Text = CStr(i)
Grid1.Row = i
Grid1.Col = 1
Grid1.Text = a(i).name
Grid1.Row = i
Grid1.Col = 2
Grid1.Text = a(i).address
Next i
End Sub
set a(i)=new person
next
Dim temp As person
Dim a(3) As personperson是啥东西。VB里面没有这东西。