<?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="if" module="max" category="Control, Math">
	<digest>
		Conditional statement in if/then/else form
	</digest>
	<description>
		Evaluates input according to a conditional statement specified in an if-then-else form.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Control
		</metadata>
		<metadata name="tag">
			Math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<!--OUTLETS-->
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="if" optional="0" type="symbol">
			<digest>
				Conditional statement
			</digest>
			<description>
				The arguments for the <o>if</o> object start with a conditional statement that uses the same syntax as <o>expr</o>. The word <m>then</m> follows the conditional statement, which is then followed by a message expression. After the message expression, there is an optional <m>else</m> and a second message expression.
				<br />
				<o>if</o> evaluates the conditional expression, and if the result is non-zero, evaluates the message expression after the word <m>then</m>. Otherwise, it evaluates the second message expression after the word <m>else</m> if an <m>else</m> message is provided.
			</description>
		</objarg>
		<objarg name="then, else" optional="0" type="symbol">
			<digest>
				Message expressions
			</digest>
			<description>
				Message expressions are similar to what you type into a <o>message</o> box.
			</description>
		</objarg>
		<objarg name="$i1, $f1, $s1" optional="0" type="symbol">
			<digest>
				Variable arguments for replacement
			</digest>
			<description>
				You use <m>$i1</m>, <m>$f1</m>, or <m>$s1</m> instead of <m>$1</m> for replaceable arguments. The number of inlets is determined by how many different changeable arguments are typed in. The maximum number of inlets is 9.
			</description>
		</objarg>
		<objarg name="send" optional="0" type="symbol">
			<digest>
				Send messages to receive objects
			</digest>
			<description>
				No commas or semicolons are allowed. Messages can be sent to remote <o>receive</o> objects by preceding the message expression with <o>send</o>, followed by the name of the <o>receive</o> object.
			</description>
		</objarg>
		<objarg name="out2" optional="0" type="symbol">
			<digest>
				Output from second outlet
			</digest>
			<description>
				The keyword <m>out2</m> in a message expression creates a second, right outlet for the <o>if</o> object. If <m>out2</m> precedes a message expression, the result of the expression is sent out the right outlet instead of the left outlet.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Evaluate the expression
			</digest>
			<description>
				In left inlet: Evaluates the conditional statement using the values currently stored.
			</description>
			<discussion>
				Any inlets which have not yet received a value have the value 0 by default.
			</discussion>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace a value and evaluate expression
			</digest>
			<description>
				The number in each inlet will be stored in place of the <m>$i</m> or <m>$f</m> argument associated with it, and the expression will be evaluated.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace a value and evaluate expression
			</digest>
			<description>
				The number in each inlet will be stored in place of the <m>$i</m> or <m>$f</m> argument associated with it, and the expression will be evaluated.
			</description>
		</method>
		<method name="ft1">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f1 value
			</digest>
			<description />
		</method>
		<method name="ft2">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f2 value
			</digest>
			<description />
		</method>
		<method name="ft3">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f3 value
			</digest>
			<description />
		</method>
		<method name="ft4">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f4 value
			</digest>
			<description />
		</method>
		<method name="ft5">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f5 value
			</digest>
			<description />
		</method>
		<method name="ft6">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f6 value
			</digest>
			<description />
		</method>
		<method name="ft7">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f7 value
			</digest>
			<description />
		</method>
		<method name="ft8">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f8 value
			</digest>
			<description />
		</method>
		<method name="ft9">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Replace the $f9 value
			</digest>
			<description />
		</method>
		<method name="in1">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i1 value
			</digest>
			<description />
		</method>
		<method name="in2">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i2 value
			</digest>
			<description />
		</method>
		<method name="in3">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i3 value
			</digest>
			<description />
		</method>
		<method name="in4">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i4 value
			</digest>
			<description />
		</method>
		<method name="in5">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i5 value
			</digest>
			<description />
		</method>
		<method name="in6">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i6 value
			</digest>
			<description />
		</method>
		<method name="in7">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i7 value
			</digest>
			<description />
		</method>
		<method name="in8">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i8 value
			</digest>
			<description />
		</method>
		<method name="in9">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Replace the $i9 value
			</digest>
			<description />
		</method>
		<method name="set">
			<arglist>
				<arg name="set-input" optional="0" type="list" />
			</arglist>
			<digest>
				Replace values without evaluation
			</digest>
			<description>
				The word <m>set</m>, followed by one or more numbers, treats those numbers as if each had come in a different inlet, replacing the stored value with the new value, but the conditional statement is not evaluated and nothing is sent out the outlet. If there are fewer numbers in the message than there are inlets, the stored value in each remaining inlet is left unchanged.
			</description>
		</method>
		<method name="symbol">
			<arglist>
				<arg name="input" optional="0" type="symbol" />
			</arglist>
			<digest>
				Replace a value and evaluate expression
			</digest>
			<description>
				A symbol will be stored in place of the <m>$s</m> argument associated with it. If received in the first inlet, the expression will be evaluated.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="if.png" caption="Complex comparisons and results can be described in a single object" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="!=" />
		<seealso name="&lt;" />
		<seealso name="&lt;=" />
		<seealso name="==" />
		<seealso name="&gt;" />
		<seealso name="&gt;=" />
		<seealso name="expr" />
		<seealso name="select" />
		<seealso name="basicchapter22" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="anything">
			<description>
				The message after the <m>then</m> or <m>else</m> portion of the arguments is sent out the outlet. If the word <m>out2</m> is present as an argument, there will be two outlets, and messages following <m>out2</m> will be sent out the right outlet. If the word <m>send</m> is present as an argument, the word that follows it is the name of a <o>receive</o> object, and the message that follows it will be sent to <o>receive</o> objects with that name.
			</description>
		</entry>
	</misc>
</c74object>
