need help with a dictionary and an array of arrays

i have a dictionary that looks something like this
keyA, (values(), values(), values())
keyB, (value())
KeyC, (values(), values(), values())

Where each value is an array of strings.

This is my method to add an entry into the dictionary:

Sub AddToResults(ID As String, data() as String) dim arr() as String if Results.HasKey(ID) then arr = Results.Value(ID) arr.Append(data) /// This line causes an exception to be raised. Results.Value(ID) = arr else Results.Value(ID) = data end if End Sub

The elements of arr are Strings, while data() is an ‘array of strings’ which is not a String so can’t be added to arr.

For an array of arrays you need to use a Variant array. This is how I’d write it… (untested)

Sub AddToResults(ID As String, data() as String) if Results.HasKey(ID) then dim arr() as Variant = Results.Value(ID) arr.Append(data) //Results.Value(ID) = arr //not necessary else dim arr() as Variant arr.Append(data) Results.Value(ID) = arr end if End Sub

Save yourself much hurt, not to mention your sanity, and make a class object to hold your data.

can a class inherit from array?

No. But a class can contain one or more arrays. You can give it methods so that it looks like an array.