VB 如何增加数组长度也不改变原来的值?

2024-12-26 08:59:06
推荐回答(1个)
回答1:

redim Preserve basicdata(1 to 6)

Private Sub Form_click()
Dim a()
ReDim a(1 To 4)
a(1) = "1"
ReDim Preserve a(1 To 6)
a(6) = "a"
For i = 1 To 6
Print a(i)
Next i
End Sub