The values returned by oList(1) and oList.ItemByIndex(1) are different.
I know that oList(1) is equivalent to oList.Item(1), and I also know that the correct usage of Item should be oList.Item(Key), but different values returned by oList(1) and oList.ItemByIndex(1) is still confusing.
This makes me sometimes have to use cArrayList instead of cCollection, but cArrayList has no JSON serialization functions.
Code:
Private Sub Form_Load()
Dim oList As cCollection
Set oList = New_c.Collection
oList.Add 111
oList.Add 222
oList.Add 333
Debug.Print oList(1)
Debug.Print oList.ItemByIndex(1)
End Sub
This makes me sometimes have to use cArrayList instead of cCollection, but cArrayList has no JSON serialization functions.