[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
downto Allows FOR Loops to Count Backward
for <index> := <start> downto <finish> do
<statement>;
The DOWNTO keyword is used when you want the index variable (<index>)
in a FOR loop to be decremented (going from a high to a low value). If
<start> is less than <finish>, then <statement> is never executed.
<index> Any declared ordinal (Integer, Char, Boolean,
enumerated) variable.
<start>,<finish> Any expression of the same type as <index>.
<statement> Any legal statement; for multiple statements, use a
compound statement.
-------------------------------- Example ---------------------------------
for I := 25 downto 17 do
writeln(I);
for Ch := 'Z' downto 'A' do
writeln(Ch);
See Also:
for
to
begin
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson