Difference between revisions of "Array IndexOf"

From MultiCharts
Jump to navigation Jump to search
(Created page with "Will return index of a specific element in one-dimensional array. Will return -1 if the array will not contain the specific element. ==Usage== <syntaxhighlight>Array_IndexO...")
 
Line 12: Line 12:
  
 
<syntaxhighlight>Value1=Array_IndexOf(Array1,4);</syntaxhighlight>
 
<syntaxhighlight>Value1=Array_IndexOf(Array1,4);</syntaxhighlight>
 +
 +
 +
[[Category:Dynamic Arrays]]

Revision as of 21:35, 27 February 2017

Will return index of a specific element in one-dimensional array. Will return -1 if the array will not contain the specific element.

Usage

Array_IndexOf(ArrayName,Value)

Where:

ArrayName - an expression specifying the name of an numerical/string/bool array.
Value - a numerical/string/bool expression specifying the value to search for.

Example

Assign an index of value 4 to Value1 variable in the numeric array Array1:

Value1=Array_IndexOf(Array1,4);