Hi guys.
I am making an app with 16 grids (xngrid from xnobjects lib). So far so good.
Now I want to make 1 search routine where I can search in any grid just referencing
the grid. My attempt:
This is far from work because Grx is not initialized. how can i make a routine
to call like: FindInGrid("Rose", Grid13, 3) ?
Or I have to write 16 searching routines, one for each grid ?
Any advice apreciated.
I am making an app with 16 grids (xngrid from xnobjects lib). So far so good.
Now I want to make 1 search routine where I can search in any grid just referencing
the grid. My attempt:
B4X:
sub Globals
dim Grx, grid1, grid2, grid3, ......grid15 as xnGrid
end sub
'
Sub FindIngrid(what As String, grad As Object, col As Int) As Int
Grx=grad
Dim rt=-1 As Int
For rw=0 To Grx.RowCount-1
If Grx.GetValue(rw, col)=what Then
rt=rw
Exit
End If
Next
Return rt ' return the found row
End Sub
This is far from work because Grx is not initialized. how can i make a routine
to call like: FindInGrid("Rose", Grid13, 3) ?
Or I have to write 16 searching routines, one for each grid ?
Any advice apreciated.