运行效果:
VB编程:巧用常量定义数组-37_彭世瑜_新浪博客_python


程序代码:
Private Const general = 5
Private Sub Command1_Click()
    Dim myarray(general - 1) As Integer
    For i = 0 To general - 1
        myarray(i) = Int(Rnd * 90) + 5
        Print myarray(i)
    Next i
End Sub