Array operator


The term array operator ([]) refers to the square brackets used to create an array. The items within the brackets, which populate the array, must be separated by a comma. When creating an array variable from the Add variable dialog, you can initialize the array using the array operator ([]). For example, you can create a Numeric array to hold a series of numeric constants.

The following are some other examples using the array operator ([]):

  • {["forty", "twelve"]}, which is a String array holding a series of strings. When specifying a String array, you must enclose the array in the evaluate-to-string operator ({}).

  • [true, false], which is a Boolean array holding 2 logical values .

  • [Blob.BlobFound(1).Fixture], which is a Fixture array holding the fixture for the first blob found. To do this, you must use the FIXTUREARRAY function.

  • [Camera.Image], which is an Image array holding the camera's image.

  • [ POINT (10,10), POINT (10,100), POINT (100,50)], which is a Point array holding a series of points initialized to constant values.

  • [Measurement.Markers.Point.Occurrences(1), Measurement.Markers.Point.Occurrences(2)], which is an Object array holding 2 measurement objects.

There is also a TimeStamp array and a PositionStamp array. You cannot specify an initial value with such arrays.