用循环语句给数组赋值后怎样读出该数组的值
Dim a()dim i
For i=0 to 14
ReDim a(i)
a(i)= "FlightMsg"&i
Next
msgbox a(0)
这里Msgbox a(0)为什么弹出为空呢?
vbs对数组支持挺差的,redim的话,是相当于重新创建一个数组,所以你原来数组里面的元素,就都没了
在for循环前加上redim,每次循环时,不去重新定义,就可以了。
Dim a()
dim i
ReDim a(14)
For i=0 to 14
a(i)= "FlightMsg"&i
Next
msgbox a(0) members = []
for i in range(7):
members.append(i)
for member in members:
print(member)
很久不用,都不会处理了
页:
[1]