<li><ahref="#forrange">for each number from to</a></li>
<li><ahref="#foreach">for each item in list</a></li>
<li><ahref="#foreachdict">for each key with value in dictionary</a></li>
<li><ahref="#while">while</a></li>
<li><ahref="#choose">if then else</a></li>
<li><ahref="#doreturn">do with result</a></li>
...
...
@@ -168,6 +169,12 @@
<p>Runs the blocks in the do section for each item in the list. Use the given variable name, <codeclass="variable block highlighter-rouge">item</code>, to refer to the current list item. You can change the name <codeclass="variable block highlighter-rouge">item</code> to something else if you wish.</p>
<h3id="foreachdict">for each key with value in dictionary</h3>
<p>Runs the blocks in the do section for each key-value entry in the dictionary. Use the given variables, <codeclass="variable block highlighter-rouge">key</code> and <codeclass="variable block highlighter-rouge">value</code>, to refer to the key and value of the current dictionary entry. You can change the names <codeclass="variable block highlighter-rouge">key</code> and <codeclass="variable block highlighter-rouge">value</code> to something else if you wish.</p>
*[for each key with value in dictionary](#foreachdict)
*[while](#while)
*[if then else](#choose)
*[do with result](#doreturn)
...
...
@@ -47,6 +48,12 @@ Runs the blocks in the do section for each numeric value in the range starting f
Runs the blocks in the do section for each item in the list. Use the given variable name, `item`{:.variable.block}, to refer to the current list item. You can change the name `item`{:.variable.block} to something else if you wish.
### for each key with value in dictionary {#foreachdict}
![](images/control/foreachdict.png)
Runs the blocks in the do section for each key-value entry in the dictionary. Use the given variables, `key`{:.variable.block} and `value`{:.variable.block}, to refer to the key and value of the current dictionary entry. You can change the names `key`{:.variable.block} and `value`{:.variable.block} to something else if you wish.