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

89 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>else</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>else.gif</image>
<code>
for(int i = 5; i &lt; 95; i += 5) {
if(i &lt; 35) {
line( 30, i, 80, i );
} else {
line( 20, i, 90, i );
}
}
</code>
</example>
<example>
<image>else2.gif</image>
<code>
for(int i = 5; i &lt; 95; i += 5) {
if(i &lt; 35) {
line( 30, i, 80, i );
} else if (i &lt; 65) {
line( 20, i, 90, i );
} else {
line( 0, i, 100, i );
}
}
</code>
</example>
<description>
Extends the <b>if()</b> structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in <b>if()</b> is <b>false</b>.
</description>
<syntax>
if(<c>expression</c>) {
<c>statements</c>
} else {
<c>statements</c>
}
if(<c>expression</c>) {
<c>statements</c>
} else if(<c>expression</c>) {
<c>statements</c>
} else {
<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>
if()
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
</root>