4

I've hit rock bottom, I can't seem to get this work!

setlocal EnableDelayedExpansion

for %%g in (1,2,3) do (
set /a c=%%g+32
echo %c%
)

pause

But it says ECHO is on, I know this means that it has nothing to display, but how couldn't it have something to display? I tried changing many things (adding/removing setlocal for example) but it won't work.

Any help is GREATLY appreciated!

1 Answer 1

4
for %%g in (1,2,3) do (
  set /a c=%%g+32
  echo !c!
)

In set /? written that we should use ! for this situation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.