% Mechanics of a loop statement.

% First, you "declare" that a loop is to begin:

loop

%	Then you put a regular Turing code in here,
%	which is executed sequentially.

%	Finally, you declare the end of the loop.

end loop


% The program will cycle through the Turing code
% within the "body" of the loop until it can escape.


% Terminating a loop:


var i: int := 10;
loop
	exit when i = 0
	put i
	i := i - 1
end loop
put i

% What is the last value printed?
