哪位VB大神帮忙解决一下,谢谢了。为啥显示不了结果,没有报错呀
OptionExplicitPrivateSubNumbers_Change(a,b)Dimnum1AsIntegernum1=a:a=b:b=num1EndSubPri...
Option Explicit
Private Sub Numbers_Change(a, b)
Dim num1 As Integer
num1 = a: a = b: b = num1
End Sub
Private Sub Numbers_Sort(arr As Variant)
Dim l As Long, i As Long, j As Long
For i = 0 To UBound(arr)
For j = i + 1 To UBound(arr)
If arr(j) < arr(i) Then
Call Numbers_Change(arr(j), arr(i))
End If
Next j
Next i
For i = 0 To UBound(arr)
Debug.Print arr(i) '在立即窗口输出数据
Next i
End Sub
Private Sub Form_Load()
Dim myarr, i As Long
myarr = Array(45, 68, 120, 31, 78)
Call Numbers_Sort(myarr)
End Sub 展开
Private Sub Numbers_Change(a, b)
Dim num1 As Integer
num1 = a: a = b: b = num1
End Sub
Private Sub Numbers_Sort(arr As Variant)
Dim l As Long, i As Long, j As Long
For i = 0 To UBound(arr)
For j = i + 1 To UBound(arr)
If arr(j) < arr(i) Then
Call Numbers_Change(arr(j), arr(i))
End If
Next j
Next i
For i = 0 To UBound(arr)
Debug.Print arr(i) '在立即窗口输出数据
Next i
End Sub
Private Sub Form_Load()
Dim myarr, i As Long
myarr = Array(45, 68, 120, 31, 78)
Call Numbers_Sort(myarr)
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询