Difference between revisions of "EXIT"

From Lianjapedia
Jump to: navigation, search
(Description)
 
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 10: Line 10:
 
==Description==
 
==Description==
 
The EXIT command causes control to drop out of a DO WHILE, SCAN or FOR...ENDFOR | 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==

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