Search 1D Array Function

Searches for an element in a 1D array starting at start index. Because the search is linear, you need not sort the array before calling this function. LabVIEW stops searching as soon as the element is found. The connector pane displays the default data types for this polymorphic function.


icon

Inputs/Outputs

  • c1ddbl.png 1D array

    1D array can be a 1D array of any type.

  • cdbl.png element

    element is the value to search for in the array. element must be the same data type as the elements in 1D array.

  • ci32.png start index (0)

    start index is the index that LabVIEW begins the search from. The default is 0.

  • ii32.png index of element

    index of element is the index where element is found.

    If the function does not find element, index of element is –1.
  • You cannot use this function to retrieve the index of a value that is not an element of the array. For example, if you have an array of two elements (0.0 and 1.0), this function does not find the index of the value 0.5, as that value is not an element of the array. Use the Threshold 1D Array to find a fractional index.

    This function only finds a string if the element you specify matches an array element exactly. For example, if you have an array of two elements (upper limit and lower limit), this function does not find the index of the value limit, because limit does not match an array element exactly. To search a string for any occurrence of a regular expression, use the Match Regular Expression function.