Quantcast
Viewing all articles
Browse latest Browse all 1686

Manually incrementing the counter in a counted DO loop?

Can it be done?

Below, I was expecting and hoping for 1 3 5 7 9.

Code:
v:\> do i=1 to 10 ( echos %i^^s & set i=%@inc[%i] )
1 2 3 4 5 6 7 8 9 10

It seems DO sets the environment variable but doesn't check/use it as the counter. I know it's ancient behavior. Is there a reason for it?

Viewing all articles
Browse latest Browse all 1686

Trending Articles