Value of variable is not changing on first iteration when input in loop, batch file -
this question has answer here:
by input value of variable not changing, on next iteration , show previous input value.
set /a firstnum=0 set /a secondnum=0 :while if %firstnum% neq -99 ( set /p firstnum="enter first number" echo first number %firstnum% ) if %secondnum% neq -99 ( :2input set /p secondnum="enter second numer" echo second number %secondnum% if %secondnum% == 0 ( goto :2input ) ) goto :while
no idea want achieve peace of nonsense if want values chenge have add setlocal enabledelayedexpansion
@ beginning of code , call variables !variable!
instead of %variable%
.
Comments
Post a Comment