mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
89 lines
1.4 KiB
XML
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 & Application</usage>
|
|
|
|
<example>
|
|
<image>else.gif</image>
|
|
<code>
|
|
for(int i = 5; i < 95; i += 5) {
|
|
if(i < 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 < 95; i += 5) {
|
|
if(i < 35) {
|
|
line( 30, i, 80, i );
|
|
} else if (i < 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>
|