ColumnIndex Property

See Also Applies To Example Model

Returns the column index of the object. Read only Long.

Example

The following example creates a checkered board pattern using the Column property.

Private Sub World1_OnSimBegin(ByVal World As World, ByVal Worms As Bots, ByVal Cells As Cells)
Cells.Color = vbtBlack
For Each Cell in Cells
     If IsEven(Cell.RowIndex + Cell.ColumnIndex) then
          Cell.Color = vbtRed
     End If
Next Cell
End Sub

Function IsEven(ByVal Number as Long) as Boolean
     If Number Mod 2 = 0 Then IsEven = true Else IsEven = false
End Function