I have a B4XTable with 3 columns using an array of columns like this:
Later I use QueryBuilder to populate the table with only 2 of the 3 columns. I can add the 2 columns B4XCol(1) and B4XCol(2) like this:
Is there a way to set up the columns using the corresponding array elements B4XCol(1) and B4XCol(2) instead of rewriting the entire 2 lines above
Thank you
B4X:
ColNames =Array As String("ID","Name", "Street")
For i= 0 To ColNames.Length -1
If i=0 Then
B4XCol(i) = B4XTable1.AddColumn(ColNames(i), B4XTable1.COLUMN_TYPE_NUMBERS)
Else
B4XCol(i) = B4XTable1.AddColumn(ColNames(i), B4XTable1.COLUMN_TYPE_TEXT)
End If
B4XCol(i).Width=ColWidthOriginal(i)
Next
Later I use QueryBuilder to populate the table with only 2 of the 3 columns. I can add the 2 columns B4XCol(1) and B4XCol(2) like this:
B4X:
B4XTable1.AddColumn("Name", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("Street", B4XTable1.COLUMN_TYPE_TEXT)
Thank you