Debian Codegraph @

docs/manual/Scripting_5_3__Jumps.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>Scripting 5.3. Jumps</title>
3 <style>
4 td { padding-left: 5pt; padding-right: 5pt; }
5 th { padding-left: 5pt; padding-right: 5pt; }
6 code { white-space: pre-wrap; }
7 dd { white-space: pre-wrap; }
8 </style>
9 </head><body bgcolor="#FFFFFF">
10
11 <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
12 Scripting 5.3. Jumps
13 </b></font></table></table>
14 <p>You can use conditional jumps in your script:</p>
15 <dl>
16 <dt><b>if</b> <i>expression</i>
17 <dt><b>elsif</b> <i>expression</i>
18 <dd>if the expression evaluates to zero or <i>false</i>, the execution of the script jumps to the next <b><code><font size=+1>elsif</font></code></b> or after the next <b><code><font size=+1>else</font></code></b> or <b><code><font size=+1>endif</font></code></b> at the same depth.</dd>
19 </dl>
20 <p>The following script computes the preferred length of a bed for a person <code><font size=+1>age</font></code> years of age:</p>
21 <code> if age &lt;= 3<br></code>
22 <code> length = 1.20<br></code>
23 <code> elsif age &lt;= 8<br></code>
24 <code> length = 1.60<br></code>
25 <code> else<br></code>
26 <code> length = 2.00<br></code>
27 <code> endif<br></code>
28 <p>A variant spelling for <b><code><font size=+1>elsif</font></code></b> is <b><code><font size=+1>elif</font></code></b>.</p>
29 <h3>Links to this page</h3>
30 <ul>
31 <li><a href="Scripting.html">Scripting</a>
32 <li><a href="Scripting_5__Language_elements_reference.html">Scripting 5. Language elements reference</a>
33 </ul>
34 <hr>
35 <address>
36 <p>© ppgb 19991112</p>
37 </address>
38 </body>
39 </html>