Skip to content

Commit 23a6456

Browse files
authored
Update 645-language-elseif.markdown
1 parent ef21239 commit 23a6456

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

_build/reference/645-language-elseif.markdown

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
> ELSEIF
44
5-
foo = 2: if foo==1: ? "one": ELSEIF foo==2: ? "two": fi
5+
Alternative condition in an IF statement.
6+
7+
### Example 1
8+
9+
~~~
10+
foo = 2
11+
if foo == 1
12+
print "one"
13+
ELSEIF foo == 2
14+
print "two"
15+
endif
16+
~~~
17+
18+
### Example 2: using IF ... ELSE ... IF instead of ELSEIF
19+
20+
~~~
21+
foo = 2
22+
if foo == 1
23+
print "one"
24+
else
25+
if foo == 2
26+
print "two"
27+
endif
28+
endif
29+
~~~
630

731

0 commit comments

Comments
 (0)