It doesn't work in Reginald, loop is not executed at all.
I know in C:
FOR (i=10;i>=0;i--) ... ;
or in BASIC:
FOR i=10 TO 0 step -1
...
next
How can I do it in REXX?
2. Re: downward loop
#1211
Posted by: 2002-10-07 05:41:10
Add the BY keyword to the end of your DO statement, and specify by how much you want to decrement the loop variable on each iteration. For example, if you want "i" to start at 20 and decrement by 1 each time you loop until it gets to 0, then add BY -1 as so:
DO i=10 TO 0 BY -1
SAY i
END
Note that this will execute the loop at total of 11 times (because it also gets executed when i = 0).