forlang.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
EXIT
                                             Up Contents Index Back
─────EXIT───────────────────────────────────────────────────────────────────
 
     Action
 
     Transfers control from within a DO or DO WHILE loop to the first
     executable statement following the end of the loop.
 
     Syntax
 
     EXIT
 
     Remarks
 
     Normally, a DO loop executes a fixed number of times. The EXIT
     statement lets you terminate the loop early.
 
     Example
 
     C     Loop terminates early if one of the data points is zero:
 
           INTEGER numpoints, point
           REAL datarray(1000), sum
 
           sum = 0.0
           DO point = 1, 1000
              numpoints = point
              sum = sum + datarray(point)
              IF (datarray(point+1) .EQ. 0.0)  EXIT
           END DO
                                    -♦-