Add Method

See Also Applies To Example Model

Adds a new item to a collection.

object expression.Add (Item)

object expression    Required. An object expression that evaluates to an object in the Applies To list.

If object expression evaluates to a Tags object:

Item    Required String. Name of the Tag object to create and add to the collection.

If object expression evaluates to a Group object:

Item    Required Bot. The Bot object to add to the collection.

If object expression evaluates to a Region object:

Item    Required Cell. The Cell object to add to the collection.

Remarks

Bot and Cell objects can only be added once to a Group or Region object, respectively.

Tag objects can only be added to the Tags collection at the Bots or Cells collection object levels.

Example

The following example creates and adds a new Tag object to the Cells object called "alive state".

Cells.Tags.Add "alive state"

The following example adds a Cell object to a Region object called "AliveCells".

For Each Cell in Cells
     If Cell.Tags("alive state").Value = 1 then
          AliveCells.Add Cell
     End if
Next Cell