|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Option Strict ON and Dictionary obectUsing Option Strict On, how does one deal with the two lines I've marked
with comments? Dim dict As Scripting.Dictionary Dim i As Integer Dim vnt As Object dict = New Scripting.Dictionary With dict ..CompareMode = Scripting.CompareMethod.BinaryCompare ..Add("a", "a") ..Add("A", "A") vnt = .Items ' Problem line End With For i = 0 To UBound(vnt) System.Diagnostics.Debug.WriteLine(VB6.TabLayout(i, vnt(i))) ' Perhaps, problem line Next i Howard,
Are you sure it is working without option strict. I would assume something as \\\ Dim dict As Scripting.Dictionary Dim i As Integer Dim vnt() As Object dict = New Scripting.Dictionary With dict .CompareMode = Scripting.CompareMethod.BinaryCompare .Add("a", "a") .Add("A", "A") vnt = Directcast(.Items,Object()) End With For i = 0 To UBound(vnt) System.Diagnostics.Debug.WriteLine(VB6.TabLayout(i, Directcast(vnt,Object())(i).ToString())) Next i /// I hope this helps, Cor Howard,
The last directcast is of course bs. the toString does it all. Sorry Cor "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message Yes.news:%23PpirySOFHA.3512@TK2MSFTNGP15.phx.gbl... > Howard, > > Are you sure it is working without option strict. > Thanx.> I would assume something as I had been awake for about 20 hours, groggier than usual (I just woke up about 15 minutes ago), when I did the code and missed out that I had to use Object() instead of Object. I was just casting to Object, not Object().
How to Share Class Properties Across Processes
no indexof-function for collection object available. Open a CSV file What is .NET Redistributable? How do I shell the following command line or process.start it (very different command!) Oledb???? Destructor for VB.NET class With different credentials. CreationTime and Windows File CreationTime why different? example of linking to other data please |
|||||||||||||||||||||||