tommycrock
Registered User.
- Local time
 - Today, 11:09
 
- Joined
 - Feb 13, 2013
 
- Messages
 - 13
 
I was working with collections for the first time yesterday and came across a couple of oddities. I was adding 7 objects, each with a unique string key. The first five objects were added fine, the last two were silently ignored. These had keys with square brackets like "[key6]" and "[key7]". Not to be deterred, I changed the key I was using to a long ID and added like
	
	
	
		
Again, this worked for the first five, then it didn't add the sixth, but now did add the seventh.
 
Anyway, that obj had id = 1. I changed the code to
	
	
	
		
And now all seven get added.
But these seem pretty odd to me and I'm worried there's going to be other circumstances I haven't predicted that will cause future objects not to be added to the collection.
BTW. This needs to be ordered so unless there's a way to write an order and a key to a dictionary it won't work here.
 
		Code:
	
	
	col.add obj, CStr(obj.id)
	Anyway, that obj had id = 1. I changed the code to
		Code:
	
	
	col.add obj, "0" & CStr(obj.id)
	But these seem pretty odd to me and I'm worried there's going to be other circumstances I haven't predicted that will cause future objects not to be added to the collection.
BTW. This needs to be ordered so unless there's a way to write an order and a key to a dictionary it won't work here.