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

64 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>if()</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>if_.gif</image>
<code>
for(int i=5; i&lt;height; i+=5) {
stroke(255); //Set the color to white
if(i &lt; 35) { //When "i" is less than "35"...
stroke(0); //...set the color to black
}
line(30, i, 80, i);
}
</code>
</example>
<description>
Allows the program to make a decision about which code to execute. If the <b>expression</b> evaluates to <b>true</b>, the statements enclosed within the block are executed and if the <b>expression</b> evaluates to <b>false</b> the statements are not executed.
</description>
<syntax>
if(<c>expression</c>) {
<c>statements</c>
}
</syntax>
<parameter>
<label>expression</label>
<description>any valid expression that evaluates to true or false</description>
</parameter>
<parameter>
<label>statements</label>
<description>one or more statements to be executed</description>
</parameter>
<returns></returns>
<related>
else
</related>
<availability>1.0</availability>
<type>Structure</type>
<partof>PDE</partof>
</root>