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 - next iteration end http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 next                Iteration end
------------------------------------------------------------------------------
 Syntax
   for <variable> := <startvalue> to|downto <endvalue> [ step <increment> ]
      <code>
   next

 Arguments
   None.

 Description
   The next statement marks the end of a loop construct started with
   the for statement.

 Example
   #define EXAMPLE_STATEMEN
   #include example.hdr

   proc Test_next
   vardef
      int     n
      logical lRepeated
   enddef
   lRepeated := .f.
   for n := 1 to 9                    // 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
   next
   ?
   for n := -200 to -150 step 10      // increment loop counter by 10
      ? n
   next
   ?
   for n := 1000 downto 800 step 50   // decrement loop counter by 50
      ? n
   next
   endproc

   proc main
   Test_next()
   endproc

See Also: for

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