The problem is i have a Dictionary with 2 options Option 1: Dictionary.Value(xy) = String(2)
Option 2: Dictionary.Value(xy) = “blabla”
So now i want to know whats the correct datatype in my Dictionary.Value(xy) like: if Dictionary.Value(xy) isA String() then…
but this dosent work… i have allready a workarround with try catch… but this is not a god solution… maybe someone have a idea how i can find out if its a array or a string.
[code]Dim dct As New Dictionary()
dct.Value(“xy”) = Array(“abc”, “def”)
’ dct.Value(“xy”) = “blabla” // uncomment this line for the string
Dim value As Variant = dct.Value(“xy”)
Select Case value.Type
Case Variant.TypeString
MsgBox(“Its is a String”)
Case Variant.TypeArray Or Variant.TypeString // Or if you prefer: Case Variant.TypeArray + Variant.TypeString
MsgBox(“Its is an Array of Strings”)
Else
MsgBox(“Whoops”)
End[/code]
[quote=193432:@Eli Ott][code]Dim dct As New Dictionary()
dct.Value(“xy”) = Array(“abc”, “def”)
’ dct.Value(“xy”) = “blabla” // uncomment this line for the string
Dim value As Variant = dct.Value(“xy”)
Select Case value.Type
Case Variant.TypeString
MsgBox(“Its is a String”)
Case Variant.TypeArray Or Variant.TypeString // Or if you prefer: Case Variant.TypeArray + Variant.TypeString
MsgBox(“Its is an Array of Strings”)
Else
MsgBox(“Whoops”)
End[/code][/quote]