VB 如何把1到10个数值 保存到数组里之后在依次取出
VB 如何把1到10个数值 保存到数组里之后在依次取出 --------------------编程问答-------------------- dim sData(0 to 9),i as integer'//保存1到10个数据
sData(0)=## '//##为你想保存的数值
sData(1)=##
....
sData(8)=##
sData(9)=##
'//读取1到10个数据
for i=0 to 9
'//将1到10个数据读取到控件text1上
text1=text1 & sData(i)
next
--------------------编程问答--------------------
--------------------编程问答-------------------- 借用楼上的修改下
dim sData() as integer
dim i as integer
for i=0 to 9
sData(i)=i '保存
next
for i=0 to 9
msgbox sData(i) '取出
next
dim sData() as integer
dim i as integer
for i=0 to 9
sData(i)=i+1 '保存
next
for i=0 to 9
msgbox sData(i) '取出
next
--------------------编程问答-------------------- ... --------------------编程问答-------------------- 路过........... --------------------编程问答-------------------- 顶起 --------------------编程问答--------------------
Private Sub Command1_Click()
a = Array(1, 5, 3, 5, 6, 9, 4, 8, 7, 10) '直接定义到数组
For i = 0 To UBound(a)
MsgBox a(i)
Next i
End Sub
补充:VB , 基础类