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 - until post-conditional iterative execution end http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 until               Post-conditional iterative execution end
------------------------------------------------------------------------------
 Syntax
   repeat
      [ <code> ]
      [ loop ]
      [ exit ]
   until <condition>

 Arguments
   <condition> is an expression that evaluates to a logical value.

 Description
   The until statement marks the end of a loop construct started
   with the repeat statement.

 Example
   #define EXAMPLE_STATEMEN
   #include example.hdr

   proc Test_until
   vardef
      uint    n
      logical lRepeated
   enddef
   n := 1                             // initialize loop control variables
   lRepeated := .f.
   repeat                             // start of loop
      ? 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
   until n >= 9                       // main loop control statement
   endproc

   proc main
   Test_until()
   endproc

See Also: repeat

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