Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - enddo pre-conditional iterative execution end http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 enddo               Pre-conditional iterative execution end
------------------------------------------------------------------------------
 Syntax
   do while <condition>
      [ <code>]
      [ loop ]
      [ exit ]
   enddo

 Arguments
   None.

 Description
   The enddo statement marks the end of the loop construct started
   with the do while statement.

 Example
   #define EXAMPLE_STATEMEN
   #include example.hdr

   proc Test_enddo
   vardef
      uint    n
      logical lRepeated
   enddef
   n := 1                             // initialize loop control variables
   lRepeated := .f.
   do while n < 10                    // main loop control statement
      ? n                             // initial processing
      if n == 5 .and. .not. lRepeated // intermediate condition 1
         ? "Repeat"
         lRepeated := .t.             // set a loop control variable
         loop                         // restart cycle
      endif
      if lRepeated                    // intermediate condition 2
         ? "Finish"
         exit                         // leave cycle
      endif
      n++                             // continued processing
   enddo
   endproc

   proc main
   Test_enddo()
   endproc

See Also: do while

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson