mcerk Posted December 24, 2004 Posted December 24, 2004 hi. is there any faster way (like: MyReader = myVariable)? While MyReader.Read ReDim Preserve myVariable(i) myVariable(i) = MyReader("id") i = i + 1 End While Quote
AFterlife Posted December 25, 2004 Posted December 25, 2004 I would use an arraylist or collection. Instead of using slow things like redim preserve. Quote
mcerk Posted December 25, 2004 Author Posted December 25, 2004 hm.... that is exacty what my question was. I don't know how to do it. Can you post sample code please? Quote
AFterlife Posted December 25, 2004 Posted December 25, 2004 Dim myVariable As New ArrayList While MyReader.Read myVariable.Add(MyReader("id")) End While Quote
mcerk Posted December 26, 2004 Author Posted December 26, 2004 I know, that this questions are newbie like, but how can I then cycle through ArrayList? if it would be ordinary array, I woudl do For i = 0 to Ubound(myVariable) Messagebox.show(myVariable(i)) Next i How can I do this with arraylist? tx, matej Quote
AFterlife Posted December 26, 2004 Posted December 26, 2004 I know, that this questions are newbie like, but how can I then cycle through ArrayList? if it would be ordinary array, I woudl do For i = 0 to Ubound(myVariable) Messagebox.show(myVariable(i)) Next i How can I do this with arraylist? tx, matej Same exact way. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.