Tag Object

See Also Properties Methods Events Model
Multiple objects
Tags
Tag

Stores data that is attached to a Bot or Cell.

Using the Tag Object

Each Tag object belongs to a Tags collection that is attached to every Bot or Cell. Tag objects can only be added at the Bots or Cells object levels and are added to all objects in the collection. Tag properties are write-only when accessed from a collection and when altered, affect all objects the belong to the respective collection.

The Value property is the default property of the Tag object.

Example

The following example creates a new Tag called "detect close bird" for the Bots collection. The Tag for each Bot object is initialized to false. Then each Bot is checked to see if it's closest neighbor Bot is within a distance of 20. If a close neighbor exists, the Tag is set to true.

Birds.Tags.Add "detect close bird"
Birds.Tags("detect close bird").value = False
For Each Bird In Birds
     If Not(Bird.Closest(20) Is Nothing) then 
          Bird.Tags("detect close bird").Value = True
     End If
Next Bird