OK! I have been going over your earlier posts (Reply #13)
NT/Win2K/XP/Vista batch language allows you to use brackets to enclose groups of commands so you can do this ...
and I think I can answer my last question. You can use the brackets to enclose any number of commands in a "for in do" statement, but they must be complete command lines, not broken up as I tried in my last example. Duh!
![Huh? ???](https://www.computerhope.com/forum/Smileys/classic/huh.gif)
I may be slow, but I think I will get it eventually.
Thanks again for explaining.
EDIT: I see now that in Reply #15, you also used the brackets in an "if then" command line:
Not just in FOR loops
IF "%var%"=="apple" (
echo it's an apple
call fruit.bat
)
I have always thought of an "if then" or "for in do" as a single command, that should all be on one line. Apparently, the "then" or "do" parts are considered as separate commands and thus may appear on the same, or separate lines.
Is that correct, or am I still way out in left field?
Thanks!
![Tongue :P](https://www.computerhope.com/forum/Smileys/classic/tongue.gif)