Specifies the array to select from.
Specifies the expression to apply to each element of the source array.
1. |
The following example selects the entire array and multiplies each element by 2. The function returns [10, 8, 6, 4, 2]. SELECT([5, 4, 3,
2, 1], Item*2)
|
2. |
SELECT can be used to create an array of point objects from the results of steps, such as BlobAnalysis, ModelFinder, or BeadInspection, that generate objects with separate values for X and Y coordinates. The following example creates the array of point objects from ModelFinder occurrences.
SELECT(Flowcharts("MainFlowchart").ModelFinder.Occurrences,
POINT(Item.X, Item.Y))
|
3. |
The following example copies an array of points from the operator view display to an array of point objects.
SELECT(OperatorInputs.Inputs("inPts").Points, Item.PixelPoint)
|
Specifies the array to select from.
Specifies the beginning of the subset of the source array.
Specifies the number of elements to include in the subset of the source array.
Specifies the expression to apply to each element of the source array.
1. |
The following example selects only the first 3 elements of the array and multiplies each by 2. The function returns [10, 8, 6]. SELECT([5, 4, 3,
2, 1], 1, 3, Item*2)
|
2. |
The following example returns an array where each element represents the difference between each element in the source array and the previous element in the source array. The array that is returned can be referred to as the difference array. Since the first element in the source array has no previous element, it is ignored when calculating the difference array (therefore the StartIndex parameter of the SELECT function is set to 2 instead of 1). SELECT
(Flowchart.MyArray, 2, ItemCount - 1,
Item.Y -
Flowchart.MyArray(Index -
1).Y)
|