<!--
* 
*
*  ProLinga-Doc
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Doc.
*
*  ProLinga-Doc is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Doc is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Doc.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->
<refentry id="cmd_endfor">
  <refmeta>
    <refentrytitle>ENDFOR Command</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>ENDFOR</refname>
    <refpurpose>End of a loop structure.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>ENDFOR</command>
  </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="cmd_endfor_introduction">
    <title>Introduction</title>
    <para>
      The <link linkend="cmd_endfor">ENDFOR</link> command is the last statement 
      of a loop structure and marks the end of it. When reaching this command, 
      processing continues at the beginning of the 
      <link linkend="cmd_for">FOR</link> or <link linkend="cmd_forever">FOREVER</link>
      loop structure of the matching <link linkend="cmd_endfor">ENDFOR</link>. In case 
      of the <link linkend="cmd_for">FOR</link> loop, the counter will be raised with 
      the STEP value. Loop structures can be nested.
    </para>
  </refsect1>

  <refsect1 id="cmd_endfor_arguments">
    <title>Arguments</title>
    <para>
      None.
    </para>
  </refsect1>

  <refsect1 id="cmd_endfor_example">
    <title>Example</title>
<programlisting>
. . .
. . .
FOR L-Counter = 1 TO 4 STEP 1
    LET V-status = CALL ProcessOrder
    IF V-status = C-Fault THEN
        CONTINUE
    ENDIF
ENDFOR
. . .
. . .
</programlisting>
  </refsect1>

  <refsect1 id="cmd_endfor_related">
    <title>Related Commands</title>
    <para>
      <link linkend="cmd_break">BREAK</link>
      <link linkend="cmd_continue">CONTINUE</link>
      <link linkend="cmd_for">FOR</link>
      <link linkend="cmd_foreach">FOREACH</link>
      <link linkend="cmd_forever">FOREVER</link>
    </para>
  </refsect1>

</refentry>

