加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有