somebody orient me on this pleaseee..
thank you very much!
:)
Printable View
somebody orient me on this pleaseee..
thank you very much!
:)
What do you want to know?
how it was use?
how would you declare a collection?
how can you store and retrieve.
anything you know about...
thank you
So basically:Code:'to declare
Private test As Collection
Private Sub Form_Load()
Dim strtest As String, itest As Integer
Set test = New Collection 'initialize
test.Add "A text item", "a key"
test.Add Text1 'a textbox is added
test.Add Command1 ' a commandbutton
test.Add strtest ' a string variable is added
test.Add itest ' a integer is added
test.Remove 2 'item 2 (the textbox is removed)
MsgBox test.Count 'the amount of items now
test.Item(2).Value = True 'the commandbutton is clicked
test.Remove "a key" 'the first item is removed, according to the key
Set test = Nothing 'remove the collection
End Sub
1. You can store almost anything in it.
2. You can retrieve them by either it's index or a key string.
3. Don't use them if you
a) aren't upto removing and adding items frequently
b) need to access them frequently in a time critical application.
- otherways you could use regular arrays.