<!--
* 
*
*  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_forever">
  <refmeta>
    <refentrytitle>FOREVER Command</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>FOREVER</refname>
    <refpurpose>Execute a block of logic commands an unlimited number of times.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>FOREVER</command>
  </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="cmd_forever_introduction">
    <title>Introduction</title>
    <para>
      The <link linkend="cmd_forever">FOREVER</link> command executes a block 
      of logic commands located between the
      <link linkend="cmd_forever">FOREVER</link> and <link linkend="cmd_endfor">ENDFOR</link> 
      logic commands an unlimited number 
      of times until a <link linkend="cmd_break">BREAK</link> command is reached. The 
      <link linkend="cmd_continue">CONTINUE</link> command can  
      be used to stop processing the current iteration and to jump to the 
      beginning of the loop.
    </para>
  </refsect1>

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

<!-- Use following layout for argument list
    <variablelist>
      <varlistentry>
	<term><option></option></term>
	<listitem>
	  <simpara>
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
-->

  </refsect1>

  <refsect1 id="cmd_forever_example">
    <title>Example</title>
<programlisting>
. . .
. . .
FOREVER
    LET V-status = CALL GetNextOrder
    IF V-status = C-OK THEN
        BREAK
    ENDIF
    CALL ProcessOrder
ENDFOR
CALL TotalOrder
. . .
. . .
</programlisting>
  </refsect1>

  <refsect1 id="cmd_forever_related">
    <title>Related Commands</title>
    <para>
      <link linkend="cmd_break">BREAK</link>
      <link linkend="cmd_continue">CONTINUE</link>
      <link linkend="cmd_endfor">ENDFOR</link>
    </para>
  </refsect1>

</refentry>

