ccarner Posted July 11, 2014 Report Share Posted July 11, 2014 Are items entered into the dictionary kept in order of insertion, ordered by key, or unordered? If I call Dictionary Get Items.vi, in what order does the dictionary return the items? Quote Link to comment
Jim Kring Posted July 11, 2014 Report Share Posted July 11, 2014 There isn't a spec for this, currently. But, I think that they are ordered by order of insertion. There has been talk of refactoring the current implementation, at some point, with variant attributes, since they are more performant. Quote Link to comment
Yair Posted July 13, 2014 Report Share Posted July 13, 2014 Expanding on Jim's reply, you might wish to just use variant attributes directly for your dictionary. The API isn't exactly the same, but you can use them to do pretty much everything that the library does and they're generally easier and faster to use. The main difference is probably that the container (the variant) is by-val and not by-ref. Regarding your specific question, in the VA case this is done by calling the get primitive without a name. I don't know what the order is (it might be insertion, it might be alphabetical, it might be based on the balancing of the tree). It should be easy enough to check. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.