You are not logged in.
Hi
Why is it not working?
%width%-1
ex
set width=80
for /l %%a in (1,1,%width%-1) do echo %%a
Offline
You can only do math with the set /a command, so you'd need to say
set width=80
set /a max_value=%width%-1
for /L %%A in (1,1,%max_width%) do echo %%A
Offline
Following on from Shadow Thief's post, set /a has a nice feature allowing you to omit the % from variables, to make your calculations easier to read.
set width=80
set /a max_value=width-1
for /L %%A in (1,1,%max_width%) do echo %%A
cmd | *sh | ruby | chef
Offline
I prefer to keep them wherever possible for consistency reasons, but there are definitely times that it's useful to not need them, like when you're dealing with multiple layers of delayed expansion.
Offline