| CODE |
SET SomeVal1 10 SET SomeCount %SomeVal1% SUB SomeCount 1 FOR I = %SomeCount% to 1 step -1 MsgBox "Loop Counter I=%I%" NEXT
FOR I = 1 to 1 MsgBox "Single Loop (1 to 1) I=%I%" NEXT
|
and I got the expected results for the first loop, without any changes to the code - msgbox showed values 9 to 1.
The small fix I did for the "single loop" worked. As I said before, it was just a matter of including the "==" condition when verifying the correctness of the parameters of start, end and step.
You can actually leave off the step -1, too.... it assumes a delta of 1 or -1, depending on the start and end values.