VB函数返回数组

Public Function GetMissWeeks() As Integer()--返回数组,所以Integer加()
  Dim i As Integer --声明循环变量i为Int类型
  Dim Array(50) As Integer --声明数组为Int类型,50代表最大的数值,即数组从【0】到【50For i=0 to 50 --循环给数组array[0]-a[50]插入数据
  Array(i) = i+3
  Next
  GetMissWeeks = Array --返回值,数组返回给本身的函数名,效果 = return
--或者 Return Array
End Function

 

posted @ 2016-06-05 16:12  阿玛  阅读(5680)  评论(0)    收藏  举报