B4J Question Return two-dimensional array with variable size

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
B4X:
'CLASS 

Sub Class_Globals
  
     Public MatrixElement(0,0) As Int
          
End Sub

Public Sub Initialize(WidthPar As Int, HeightPar As Int)

    Dim MatrixElement(WidthPar,HeightPar) As Int
     
End Sub

Public Sub GetMatrixElement(Element As Int) As Int(,)

    'Do Something
              
    Return MatrixElement
  
End Sub

As Int(,)???

This seems to work but is it okay to do this?

Thank You.
 
Top