Multi-dimensional array - Question on Data types

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

Is is possible to declare a 2-dimensional array, the first dimension being
an Integer and the 2nd dimension another data type, say string?

Or, is this a bad choice and a dataset may be a better way of handling
multi-dimensional data where the data types may not be the same?

venki
 
vvenk said:
Hello:

Is is possible to declare a 2-dimensional array, the first dimension being
an Integer and the 2nd dimension another data type, say string?

venki
Not that I know of, but look up Structure under Help. That's what I
would suggest as your best option.

eg.
Private Structure myStructure
Dim iInteger as Integer
Dim sString as String
End Structure
Dim myArray() as myStructure


Hope this helps,

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 
vvenk said:
Hello:

Is is possible to declare a 2-dimensional array, the first dimension being
an Integer and the 2nd dimension another data type, say string?

Or, is this a bad choice and a dataset may be a better way of handling
multi-dimensional data where the data types may not be the same?

venki

venki,

Can you give us some more detail on what you want to accomplish? I
have a feeling that there maybe a be a better way to accomplish what
your after, but a brief description might help us better help you.
 
vvenk,

If it is only an array, than a generic list of your own class is in my idea
the most simple.

Class TheClass
public a as string
public b as string
End Class

Dim a As New List(Of theclass)
a.Add(New theclass)
a(0).a = 0
a(0).b = "mystring"

Although see that the class is terrible made, properties and a constructor
would make it nicer (better)

Cor
 
Back
Top