<?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="substitute" module="max" category="Messages">
	<digest>
		Substitute symbols within a message
	</digest>
	<description>
		Matches messages to its own arguments; whenever it finds a match, will make the appropriate substitution.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Messages
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Message For Substitution
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Change Substitution
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Newly Substituted Message
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Message That Was Left Intact
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="match" optional="1" type="anything">
			<digest>
				Match value
			</digest>
			<description>
				The first number or symbol specifies the match, which identifies what should be replaced in an incoming message. The default match value is 0.
			</description>
		</objarg>
		<objarg name="replacement" optional="1" type="anything">
			<digest>
				Replacement value
			</digest>
			<description>
				The second number or symbol specifies the replacement for the match. The default replacement value is 0.
			</description>
		</objarg>
		<objarg name="mode" optional="1" type="anything">
			<digest>
				First instance mode
			</digest>
			<description>
				Any third number or symbol sets the &quot;replace first message only&quot; mode of the <o>substitute</o> object. Only the first instance of the specified match will be replaced.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Same as <m>anything</m>.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Same as <m>anything</m>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Same as <m>anything</m>.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Same as <m>anything</m>.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: The input is echoed to the output, but if the message received contains an element matching the match symbol or number, the element is replaced by the replacement symbol or number when the message is repeated to the output.
				<br />
				<br />
				In right inlet: The <o>substitute</o> object accepts a message of two numbers or symbols in its right inlet. The first number or symbol specifies the match, which identifies what should be replaced in an incoming message.
			</description>
		</method>
		<method name="set">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Same as <m>anything</m>.				<br />
				In right inlet: Same as <m>anything</m>, except that the word set is ignored.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="substitute.png" caption="substitute can translate messages output by one object to what's expected by another object" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="route" />
		<seealso name="sprintf" />
		<seealso name="zl" />
	</seealsolist>
	<misc name="Output">
		<entry name="anything">
			<description>
				Out left outlet: The input message is echoed to the output with elements matching the match symbol or number replaced by the replacement number or symbol.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out right outlet: If no substitution occurred when sending out the incoming message, the original input message is passed out the rightmost outlet.
			</description>
		</entry>
	</misc>
</c74object>
