I'm using Access 2010 under Win7. I've discovered I can dimension my arrays at run-time by simply invoking ReDim arrayName(x)
without first declaring the array as Dim arrayName()
.
Sub FooBar()
ReDim myArray(2)
myArray(0) = "This is the first string in myArray."
myArray(1) = "This is the second string in myArray."
myArray(2) = "And this is the last string in myArray."
MsgBox myArray(0) & vbCrLf & myArray(1) & vbCrLf & myArray(2)
End Sub
Is there any reason I should NOT use this shortcut?
Cheers!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…