Quantcast
Viewing all articles
Browse latest Browse all 1751

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

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.

Image may be NSFW.
Clik here to view.
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 1751

Trending Articles