Click to See Complete Forum and Search --> : array
toraj
Dec 16th, 1999, 05:13 PM
i want to use array , but i do not know the
range of array at design time , it depend on
how users use that program . what is the way of this problem , how can define a unlimited array .is it possible ?
Joacim Andersson
Dec 16th, 1999, 06:01 PM
You can ReDim your arrays during run-time.
Private iMyArr() As Integer
Private Sub Form_Load()
ReDim iMyArr(100)
'or to preserve the array values:
ReDim Preserve iMyArr(200)
End Sub
Good luck!
------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)
MartinLiss
Dec 16th, 1999, 09:58 PM
You can also use a collection instead of an array. You just add items to the collection as you need to and you don't have to redim.
------------------
Marty
Serge
Dec 16th, 1999, 10:01 PM
Marty is right, Collection items can be just removes using Remove method. But array are much faster. So, if you're going for the speed, use Array, if you're going for flexebility, use Collections
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.