Back to manual index

:: while .. do

:: Example #1
program WhileExample1;

var loop1 : integer;
    loop2 : integer;

begin

  loop1 := 0;
  loop2 := 12;
  while loop1 < 10 do
  begin
    loop1 := loop1 + 1;
    loop2 := loop2 + 2;
    writeln('loop1 = ',loop1:2,' loop2 = ',loop2);
  end;
  
end.
:: Example #2
program WhileExample2;

var loop1 : integer;
    loop2 : integer;

begin

  while count 12 do
  begin
    loop1 := loop1 + 1;
    loop2 := loop2 + 2;
    writeln('loop1 = ',loop1,' loop2 = ',loop2);
  end;
  
end.
::Condition parameters :
> is greater than
< is less than
<= is less than equal to value
>= is greater than equal to value