Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> repeat repeat/until condition pp 61</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 REPEAT                     Repeat/Until Condition                     pp 61


 Define:  Repeat until a Boolean condition becomes True.

 Purpose: Provide indeterminate looping.

 Notes:   Repeat will always execute at least once.

          The expression controlling the repetition must be of type
          Boolean.  The sequence of statements between the reserved words
          Repeat and Until is executed repeatedly until the
          controlling expression becomes True.


 ----------------------------------------------------------------------------


 Usage:
       VAR
          Answer : Char;

       BEGIN
          Repeat
            WriteLn ('Enter Y/N');            { Write request to user     }
            ReadLn  (Answer);                 { Get user input            }
            Until   (Answer) in ['Y','N'];    { Loop until True condition }
       END.

See Also: For/To While

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