Guys
I need to pass a two dimentional array to a funtion - work on it and return the array results. I can achieve it with a one dimentional array but I'm having problems with 2.
Printable View
Guys
I need to pass a two dimentional array to a funtion - work on it and return the array results. I can achieve it with a one dimentional array but I'm having problems with 2.
vb.net Code:
Public D2Array(,) As String = {} Public Function Take2D(ByVal strArray(,) As String) As String(,) 'Work Return strArray End Function Private Sub My_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load D2Array = Take2D(D2Array) End Sub
That should work, I use VB.net, so the syntax might be a bit different.
Thanks for that.
The problem was :-
HTML Code:Structure OSMTileName
Public OSMColumn As Integer
Public OSMTile As Integer
Public Name As String ' Tile Name
Public OSMTileDetails As TileDetails
End Structure
Structure TileDetails
Public X As Double ' Lon
Public Y As Double ' Lat
Public Height As Double ' Lon span
Public Width As Double ' Lat span
End Structure
I changed it to:-HTML Code:Private Sub LoadMapGrid(ByRef ThisArray As Array, ByVal Lat As Double, ByVal Lon As Double, ByVal z As Integer)
HTML Code:Private Sub LoadMapGrid(ByRef ThisArray(,) As OSMTileName, ByVal Lat As Double, ByVal Lon As Double, ByVal z As Integer)