[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.301 while

Synopsis

 
while boolean expression do
  statement

Description

The `while' statement declares a loop. For further description see section 8.1.7.6 while Statement.

Conforming to

`while' is defined in ISO-7185 Pascal and supported by all known Pascal variants.

Example

 
program WhileDemo;
var
  Foo, Bar: Integer;
begin
  WriteLn ('Enter an descending series of integer numbers.');
  WriteLn ('Terminate by breaking this rule.');
  WriteLn ('Enter start number: ');
  Bar := MaxInt;
  ReadLn (Foo);
  while Foo < Bar do
    begin
      Bar := Foo;
      ReadLn (Foo)
    end;
  WriteLn ('The last number of your series was: ', Bar)
end.

See also

section 8.1.7.7 repeat Statement, section 8.1.7.5 for Statement



This document was generated by Frank Heckenbach on May, 10 2002 using texi2html