Difference between revisions of "LOOP"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Force control to beginning of a looping command
 
Force control to beginning of a looping command
 
  
 
==Syntax==
 
==Syntax==
LOOP
+
LOOP [IN <workarea>|<alias>]
 
+
  
 
==See Also==
 
==See Also==
[[DO WHILE]], [[EXIT]], [[FOR]]
+
[[DO WHILE]], [[EXIT]], [[FOR]], [[SCAN]]
 
+
  
 
==Description==
 
==Description==
The LOOP command forces program control to the top of the closest DO WHILE or FOR...NEXT loop.
+
The LOOP command forces program control to the top of the closest DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop.
  
 +
====IN <workarea>|<alias>====
 +
If the workarea number, letter or alias name is specified, the LOOP is carried out in that workarea.  From v6.0.
  
 
==Example==
 
==Example==
Line 27: Line 26:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Applications]]
+
[[Category:Looping Commands]]
[[Category:Applications Commands]]
+
[[Category:NoSQL Commands]]

Latest revision as of 08:35, 4 January 2021

Purpose

Force control to beginning of a looping command

Syntax

LOOP [IN <workarea>|<alias>]

See Also

DO WHILE, EXIT, FOR, SCAN

Description

The LOOP command forces program control to the top of the closest DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop.

IN <workarea>|<alias>

If the workarea number, letter or alias name is specified, the LOOP is carried out in that workarea. From v6.0.

Example

use patrons index events, names
do while not eof()
    if deleted()
        loop
    endif
    display event, name, seats, seats * price
    skip
enddo