ReDim是重新定义数组的大小
加上Preserve使数组中已赋值的那些数据不被清空
例如
dim A(3)
A(0)=A(1)=A(2)=A(3)=1
Redim Preserve A(4) ‘数组变大了,之前赋值的数据不变
A(4)=2 ‘赋值给A(4)
for i = 0 to 4
print A(i)
next
时间: 2024-10-08 05:36:04
ReDim是重新定义数组的大小
加上Preserve使数组中已赋值的那些数据不被清空
例如
dim A(3)
A(0)=A(1)=A(2)=A(3)=1
Redim Preserve A(4) ‘数组变大了,之前赋值的数据不变
A(4)=2 ‘赋值给A(4)
for i = 0 to 4
print A(i)
next