I need to create a 2D array of a structure like this:

Public Struct Tile_Normals
   A[3] As Single  ' Normal for quad subsurface A.
   B[3] As Single  ' Normal for quad subsurface B.
End Struct

Dim Normals As New Tile_Normals[TileGrid.Size, TileGrid.Size]

When I try to assign a value to an array element like this:

Normals[TileGridX, TileGridY].A = Convert.Normal(P1, P2, P3)

I get a "null object" error. While the 2D array of structures seems to 
be created correctly, all its initial values are indeed "null". Do I 
need to create the structure or array differently so I can properly 
assign values to it?

Previously I knew all the dimensions of my arrays of structures so they 
were statically defined, but in this case I don't know the array 
dimensions until after the program has started running. Thanks everyone.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to