Sub Globals
Dim Rows(,) as Byte
End Sub
Sub ReadData(data() as Byte)
Dim totalrows as Int
Dim rowitems as Int
Dim actualrow as Int
Dim item as Int
Rows = null
' Count the number of rows
totaltows = 0
For i = 0 To data.Length - 1
If data(i) = 64 Then totalrows = totalrows + 1
Next
' HERE I SHOULD SET THE NUMBER OF ROWS
' BUT THIS IS NOT CORRECT
Dim Rows(totalrows,) as Byte
' Count the items for each row
actualrow = 0
rowitems = 0
For i = 0 To data.Length - 1
If data(i) = 64 Then
' HERE I SHOULD SET THE NUMBER OF ITEMS OF THE CURRENT ROW
' BUT THIS IS NOT CORRECT
Dim Rows(actualrow, rowitems) as Byte
rowitems = 0
actualrow = actualrow + 1
Else
rowitems = rowitems + 1
End If
Next
' Now I can put data into the array
actualrow = 0
item = 0
For i = 0 To data.Length
If data(i) <> 64 Then
If Rows(actualrow, item) = 0 Then Rows(actualrow, item) = data(i)
item = item + 1
Else
actualrow = actualrow + 1
item = 0
End If
Next
End Sub