VB.Net - Syntax



Dim dicObjects As System.Collections.Generic.Dictionary(Of String, MyObject) 
dicObjects = New System.Collections.Generic.Dictionary(Of String, MyObject)

Dim adicStrings As New System.Collections.Generic.Dictionary(Of String, String()) 
adicStrings = New System.Collections.Generic.Dictionary(Of String, String())

adicStrings.Add(key,value)
adicStrings.Add("Item1", ??)
??


Dim dicAuthors As System.Collections.Generic.Dictionary(Of String, String) 
dicAuthors = New System.Collections.Generic.Dictionary(Of String, String)

dicAuthors.Add(key, value)
dicAuthors.Add("001", "my first string")
dicAuthors.Add("002", "my second string")

Dim objKeyValuePair As System.Collections.Generic.KeyValuePair(Of Integer, String) 

For Each objKeyValuePair In dicItems
   Debug.Print objKeyValuePair.Key & " - " & objKeyValuePair.Value
Next objKeyValuePair


Dim myDictionary As System.Collections.Generic.Dictionary(Of String, String) 
Dim myBoolean As Boolean
myBoolean = True
myDictionary.Add("string", myBoolean) // this works but in C# the conversion has to be explicit
myDictionary.Add("string", myBoolean.ToString());

For icount As Integer = 0 To (dicAuthors.Count - 1) 
   snamesarray.GetValue(icount)
Next icount

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext