Files
processing4/web/reference/API/logicalAND.xml
2005-01-27 06:48:42 +00:00

65 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&amp;&amp; (logical AND)</name>
<category>Control</category>
<subcategory>Logical Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>logicalAND.gif</image>
<code>
for(int i=5; i&lt;=95; i+=5) {
if((i &gt; 35) &amp;&amp; (i &lt; 60)) {
stroke(0); //Set color to black
} else {
stroke(255); //Set color to white
}
line(30, i, 80, i);
}
</code>
</example>
<description>
Compares two expressions and returns <b>true</b> only if both evaluate to <b>true</b>. Returns <b>false</b> if one or both evaluate to <b>false</b>. The following list shows all possible combinations:<br /><br /><tt>true &amp;&amp; false // Evaluates false because the second is false <br />false &amp;&amp; true // Evaluates false because the first is false <br />true &amp;&amp; true // Evaluates true because both are true <br />false &amp;&amp; false // Evaluates false because both are false</tt>
</description>
<syntax>
<c>expression1</c> &amp;&amp; <c>expression2</c>
</syntax>
<parameter>
<label>expression1</label>
<description>any valid expression</description>
</parameter>
<parameter>
<label>expression2</label>
<description>any valid expression</description>
</parameter>
<returns></returns>
<related>
|| (logical OR)
! (logical NOT)
if()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>