REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Leave an outer loop from an inner loop





 
/* code sequence showing a technique to leave an outer loop in        */
/* an inner loop                                                      */

  do i=1 until 1=0              /* i is a dummy variable for the      */
                                /* leave command                      */
                                /* UNTIL 1=0 simulates "FOREVER"      */
    do j=4 to 45
      r = 1
      do while ( r.j <> t.j )
        r = r + 1
        if r.j = "EXIT" then
          leave i               /* abort the UNTIL loop               */
      end /* do while ( r.j <> t.j ) */
    end  /* do j=4 to 45 */
  end /* do i=1 UNTIL 1=0 */

  

Inf-HTML End Run - Successful