| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
while boolean expression do statement |
The `while' statement declares a loop. For further description see section 8.1.7.6 while Statement.
`while' is defined in ISO-7185 Pascal and supported by all known Pascal variants.
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.
|
section 8.1.7.7 repeat Statement, section 8.1.7.5 for Statement