I think this may be why I refused to use parenthesis in if/fore statements from 1988 until 2023...... Suddenly not being able to do things I normally do.
But i see now that technically, the documentation says this is invalid.
But i feel like this kinda defeats the purpose of using parethesis for large blocks of code?
I get why this would make sense for a (command group of one line)
but i don't get why this would make sense for a (
command
group
of
several
lines
)
Correctly outputs 'foo bar baz':
Outputs nothing but having unreachable lines of BAT doesn't feel right:
The only difference is me remarking the label out. That makes the output happen.
But use a label? Everything past it is unreachable code.
Basically means we can't use labels inside a for loop.
Am I crazy in that i think this should be allowed?
But i see now that technically, the documentation says this is invalid.
But i feel like this kinda defeats the purpose of using parethesis for large blocks of code?
I get why this would make sense for a (command group of one line)
but i don't get why this would make sense for a (
command
group
of
several
lines
)
Correctly outputs 'foo bar baz':
Code:
@Echo off
for %value in (foo bar baz) do (
REM :label
echo %value
)
Outputs nothing but having unreachable lines of BAT doesn't feel right:
Code:
@Echo off
for %value in (foo bar baz) do (
:label
echo %value
)
The only difference is me remarking the label out. That makes the output happen.
But use a label? Everything past it is unreachable code.
Basically means we can't use labels inside a for loop.
Am I crazy in that i think this should be allowed?