<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="array.indexof" module="max" category="Array">
	<digest>
		Search for the index of an array element.
	</digest>
	<description>
		Output the position of an array element within a longer array as an integer index (0-based). Output <m>-1</m> if the element cannot be found.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			array
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				array in
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				array in
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				index out
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Trigger output
			</digest>
			<description>
				Reprocess previously received arrays and trigger output.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="value" type="int" optional="0" />
			</arglist>
			<digest>
				Convert an integer to an array.
			</digest>
			<description>
				Convert an incoming integer to an array, then process as described for the <m>array</m> message.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="value" type="float" optional="0" />
			</arglist>
			<digest>
				Convert a floating-point number to an array.
			</digest>
			<description>
				Convert an incoming floating-point number to an array, then process as described for the <m>array</m> message.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="list-value" type="list" optional="0" />
			</arglist>
			<digest>
				Convert a list to an array.
			</digest>
			<description>
				Convert an incoming list to an array, then process as described for the <m>array</m> message.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="list-value" type="list" optional="0" />
			</arglist>
			<digest>
				Convert a list to an array.
			</digest>
			<description>
				Convert an incoming list to an array, then process as described for the <m>array</m> message.
			</description>
		</method>
		<method name="array">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Set the array to search in.
			</digest>
			<description>
				This search is case-sensitive. Will output the position of the provided element (left inlet) in the larger array (right inlet) if found, otherwise will output <m>-1</m>.				<br />
				<br />
				A multiple-element input in the left inlet will match an array (e.g. <m>a b c</m> will find index 2 of <m>[ 1, 2, [ a, b, c ], 4]</m>), but does not match a sequence of individual elements (that is, <m>a b c</m> will not find anything in <m>[ 1, 2, a, b, c, 4 ]</m>).
			</description>
		</method>
		<method name="dictionary">
			<arglist>
				<arg name="dictionary-value" type="list" optional="0" />
			</arglist>
			<digest>
				Wrap a dictionary object in an array.
			</digest>
			<description>
				Wrap an incoming dictionary object in an array, then process as described for the <m>array</m> message.
			</description>
		</method>
		<method name="string">
			<arglist>
				<arg name="string-value" type="list" optional="0" />
			</arglist>
			<digest>
				Wrap a string object in an array.
			</digest>
			<description>
				Wrap a string object in an array, then process as described for the <m>array</m> message.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="all" get="1" set="1" type="int" size="1">
			<digest>
				Output all matching indices
			</digest>
			<description>
				All matching indices will be output as a list. If there are no matches, a single <m>-1</m> will be output.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Output all matching indices" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="offset" get="1" set="1" type="int" size="1">
			<digest>
				Offset in array to begin search
			</digest>
			<description>
				Offsets are 0-based. If you want to sequentially search an array for an element, pass the (previous match + 1) as the offset and send a <m>bang</m> to get the next match. A <m>-1</m> will be output when there are no more matches.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Offset in array to begin search" />
				<attribute name="min" get="1" set="1" type="int" size="1" value="0" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="array" />
		<seealso name="array.foreach" />
		<seealso name="zl.sub" />
	</seealsolist>
</c74object>
