I am converting a VB6 project to C# .Net but I have problems using Scripting.Dictionary. The error message is ” Scripting.Dictionary.this[ref object]’ is not supported by the language “. I want to get the item for a specific key.
key=astr[n];
Scripting.Dictionary m_dicValueOf;
strXPath = m_dicValueOf[astr[n]];
You can’t use
reforoutparameters in an indexer in C#, so you can’t use an indexer that has areforoutparameter.(The reasoning behind the limitation in the language is of course that it makes no sense what so ever to change the key that you send to an indexer.)
Use the
Dictionary<K,V>class from the framework instead. Example: