Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1689

can somebody please explain how this is not a bug? what am i missing?

$
0
0
First off: Why is the second loop's first value 4 and not 1? Why is it not re-initialized as part of the do?

Second off: Why is enddo an unknown command? I literally copied the same code

If I change the if them to use gotos instead of parens, this error goes away.


Stuff like this is why I got into the 25 year habit of never using parens with if statements, which resulted in some ugly code.

1728319016727.webp



Code:
@Echo off

set num_seconds=3

do second = 1 to %num_seconds% by 1
        echo...

Read more

Viewing all articles
Browse latest Browse all 1689

Trending Articles