Private Sort(Var Num(3) as integer)
Dim i As Integer
Dim j As Integer
Dim k As Integer
For i = 1 To 3
For j = 1 To 3
  If Num(j) < Num(i) Then
    k = Num(i)
    Num(i) = Num(j)
    Num(j) = k
  End
Next
Next
End Sub
为什么说Private Sort(Var Num(3) as integer)这句出错了?

解决方案 »

  1.   

    ivate Sort(Var Num(3) as integer)
    改为
    Private sub Sort(byVal Num() as integer)
      

  2.   

    应该ByRef方式定义参数,Private sub Sort(Num() as integer)
      

  3.   

    楼上的参考帖
    http://community.csdn.net/Expert/topic/4958/4958059.xml?temp=.407406
    http://community.csdn.net/Expert/topic/4983/4983218.xml?temp=3.759402E-02
      

  4.   

    http://community.csdn.net/Expert/TopicView.asp?id=4958059
    http://community.csdn.net/Expert/TopicView.asp?id=4983218
      

  5.   

    For j = 1 To 3应是for j=i+1 to 3