Tag Archives: dictionary

Help editing JSON to make an array rather than a 'dictionary'

Questions: I currently have json using json_encode from a mysql query which looks like this: {“post_2”:{“caption”:”…”,”id”:”…”,”accountID”:”..”,”date”:”07\/07\/2011 1:45:12 AM”,”title”:”…”,”authorInfo”:{“Email Address”:”…”}}}, {“post_2”:{“caption”:”…”,”id”:”…”,”accountID”:”..”,”date”:”07\/07\/2011 1:45:12 AM”,”title”:”…”,”authorInfo”:{“Email Address”:”…”}}} How can I have the json being an array of posts (‘post_2’, ‘post_1’) rather than it being a dictionary? The JSON will be decoded on an iPhone using SBJSON and the JSON… Read More »

Dictionary in VBA is created with empty key value pair

Questions: After creating a new dictionary: Dim teams as Dictionary Set teams = New Dictionary I noticed that it already contains empty key – value pair (teams.Count returns value of 1). How can I prevent this from happening or delete this pair? Is this normal behaviour? Answers: If you are referencing the same Microsoft Scripting… Read More »

How can I seek key of dictionary by index value?

Questions: How can I get the key of a dictionary by passing the index value? I’m trying: If rs.Fields(“NM”).Value = dictNM.key(0) that is, I want it to compare to the first key in the dictionary but I get the error Compile error: Invalid use of property I tried googling, but to no avail. I’m hoping… Read More »

Fastests way to empty a dictionary into an Excel sheet

Questions: What is the fastest way to empty a Scripting.Dictionary into an excel sheet? This is what I’m doing right now, but for a dictionary with about 3000 elements, it’s noticeably slow. I’ve made every optimization I can think of. Here’s a bare-bones version of what I have: ‘wordCount and emailCount are late bound “Scripting.Dictionary”… Read More »