summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/algorithm2e/doc/algorithm2e_ex07.tex
blob: 7aecb14f2d1d5a0a5812231e45b3f8c71197498c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Let's have a look at what we can do
with if-then-else and side comments\;
\eIf{if-then-else test}{
  no comment here\;
  neither in then\;
}{
  nor in else\;
}
\eIf(\tcc*[f]{then comment}){test}{
  then with a comment\;
}(\tcc*[f]{comment in else})
{
  here we are in else\;
}
\eIf(\tcc*[f]{then comment}){test}{
  again a comment in then\;
}{
  but not in else\;
}
\eIf{if-then-else test}{
  this time, no comment in then\;
}(\tcc*[f]{else comment})
{
  but one comment in else\;
}
Let's try with other if possibilities\;
\lIf(\tcc*[h]{lif comment}){test}{text}
\uIf(\tcc*[f]{uif comment}){test}{
  then text\;
}
\uElseIf(\tcc*[f]{comment}){test}{
  elseif text\;
}
\lElseIf(\tcc*[h]{comment}){test}{text}
\lElse(\tcc*[f]{comment}){text}