vb如何为数组赋初值
(2019-01-24 09:48:06)
标签:
vb数组数组赋值 |
分类: 程序设计_VB |
1. 直接赋值,此法只适合和小数组
Dim myArray() as Integer ={1,2,3,4,5}
或Dim myArray(5)as integer
myArray(0)=1
myArray(1)=2
myArray(2)=3
myArray(3)=3
myArray(4)=5
myArray(5)=6
2.最常用的for next循环赋值
Dim myArray()as integer
For intCount as Integer= 0 to 5
myArray(intCount)=你要赋值的东西
Next
如果你要每个都不同那就这样:
Dim myArray()as integer
Dim FuZhi as integer
For Fuzhi as 0 to 5
For intCount as Integer= 0 to 5
myArray(intCount)=fuzhi
Next intCount
Next fuzhi
摘录至:https://zhidao.baidu.com/question/98049937.html
前一篇:VB操作Access数据库方法