Sub GetView(Row As Int, Col As Int) As Label
' Returns the label in the specific cell
   Dim L As Label
   L = Table.GetView(Row * NumberOfColumns + Col)
   Return L
End Sub
Sub AddRow(Values() As String)
' Adds a row to the table
   Dim ColWidth As Int
   
   If Values.Length <> NumberOfColumns Then
      Log("Wrong number of values.")
      Return
   End If
   ColWidth=0
   For i = 0 To NumberOfColumns - 1
      Dim L As Label
      L.Initialize("cell")
      L.Text = Values(i)
      L.Gravity = Alignment(i)
      L.TextSize = FontSize(i)
      L.TextColor = FontColor(i)
      L.Color=CellColor(i)
      Dim rc As RowCol
      rc.Initialize
      rc.Col = i
      rc.Row = NumberOfRows
      L.Tag = rc
      Table.AddView(L, ColWidth, RowHeight * NumberOfRows, ColumnWidth_1(i), RowHeight_1)
      ColWidth=ColWidth+ColumnWidth(i)
      If i = 0 AND GetView(rc.Row,1).Text = "Something" Then L.Color = Colors.Red 
'this is what I added. Basically, for Col0 only, if the cell after (same row, Col1) says "something", 
'I want Col0's cell to be red for that line, otherwise stay as predefined. However when I use this 
'construct, it tells me View should be initialised first. And I'm not too sure it will work anyway.
   Next
   
   NumberOfRows=NumberOfRows+1
   Table.Height = NumberOfRows * RowHeight
End Sub