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 ?
Printable View
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 ?
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
[email protected]
[email protected]
www.YellowBlazer.com
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
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
[email protected]
[email protected]
ICQ#: 51055819