[CLOSE ] LOOP [(r)]
|
This document covers the following topics:
The LOOP
statement is used to close a processing loop. It
causes processing of the current pass through the loop to be terminated and
control to be returned to the beginning of the processing loop.
When the processing loop for which the LOOP
statement is
issued is terminated (that is, when all records have been processed or
iterations have been performed), execution continues with the statement after
the LOOP
statement.
A LOOP
statement, in addition to closing a processing
loop, will eliminate all field references to FIND
, FIND FIRST
,
FIND UNIQUE
,
READ
and
GET
statements contained
within the loop.
A field within a view may be referenced outside the processing loop by using the view name as a qualifier.
This statement is for reporting mode only.
A LOOP
statement may not be specified based on a
conditional statement such as IF
or AT BREAK
.
Syntax Element | Description |
---|---|
LOOP
(r)
|
Statement Reference Notation:
The |
Note:
In reporting mode, any processing loop which is currently active,
that is, which has not explicitly been closed with a LOOP
statement, will be closed automatically by an END
statement.
FIND ... READ ... READ ... LOOP (0010) /* closes all loops
FIND ... READ ... READ ... LOOP /* closes loop initiated on line 0030 LOOP /* closes loop initiated on line 0020 LOOP /* closes loop initiated on line 0010