summaryrefslogtreecommitdiff
path: root/Help/command/foreach.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/command/foreach.rst')
-rw-r--r--Help/command/foreach.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index 8de6debae4..d9f54ca750 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -14,9 +14,12 @@ semicolon or whitespace.
All commands between ``foreach`` and the matching ``endforeach`` are recorded
without being invoked. Once the ``endforeach`` is evaluated, the recorded
list of commands is invoked once for each item in ``<items>``.
-At the beginning of each iteration the variable ``loop_var`` will be set
+At the beginning of each iteration the variable ``<loop_var>`` will be set
to the value of the current item.
+The scope of ``<loop_var>`` is restricted to the loop scope. See policy
+:policy:`CMP0124` for details.
+
The commands :command:`break` and :command:`continue` provide means to
escape from the normal control flow.