Difference between revisions of "EXIT"

From Lianjapedia
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Force exit from a DO WHILE loop
+
Force exit from a DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop
  
 
==Syntax==
 
==Syntax==
EXIT
+
EXIT [IN <workarea>|<alias>]
  
 
==See Also==
 
==See Also==
Line 9: Line 9:
  
 
==Description==
 
==Description==
The EXIT command causes control to drop out of a DO WHILE or FOR...NEXT loop.
+
The EXIT command causes control to drop out of a DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop.
 +
 
 +
====IN <workarea>|<alias>====
 +
If the workarea number, letter or alias name is specified, the EXIT is carried out in that workarea.  From v6.0.
  
 
==Example==
 
==Example==
Line 26: Line 29:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Applications]]
+
[[Category:NoSQL Commands]]
[[Category:Applications Commands]]
+

Latest revision as of 08:35, 4 January 2021

Purpose

Force exit from a DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop

Syntax

EXIT [IN <workarea>|<alias>]

See Also

DO WHILE, FOR, LOOP, SCAN

Description

The EXIT command causes control to drop out of a DO WHILE, SCAN or FOR...ENDFOR | FOR...NEXT loop.

IN <workarea>|<alias>

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

Example

use patrons index events
seek "BALLET"
do while not eof()
    if event<>"BALLET"
        exit
    endif
    display name, event, seats, seats * price off
    skip
enddo