简体   繁体   中英

VB.net Array of Array

I've been searching for an example for array of arrays but I couldn't find any. Any link or explanation will be great.

What I'm really trying to do: I have angles and edges of polygons and I want to insert those informations inside array, It looks like this at the time:

Dim edges() as integer
Dİm angles() as integer
??Dim ArrayOfArray as integer??

Private sub AddPolygonToArray
for i = 0 to x
edges(i) = edge
angles(i) = angle
next
??ArrayOfArray(index) = new Array(edges,angles,NameOfPolygon,QuantityOfPolygon)??
End Sub
  • Index,nameofpolygon and quantityofpolygon are not necessary, but they're integers if you need to know. If anything is incomprhensible, don't be afraid to ask. Thanks in advance

There are two types of multidimensional Arrays

Regular multidimensional array

Dim mdArray(5, 5, 5) as integer

And Jugged Array (Array of Arrays)

Dim jugged()() as integer

Since geometry is all about 3 dimensions, I believe, you can describe any shape using 3-dimentional array such as mdArray(5, 5, 5)

You should do a List(Of Polygon) .

But if you can't, you can always do a Multidimensional Array

This means that you can do

Dim MultiArray(X,Y,Z,W)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM