0

by input the value of variable is not changing, but on next iteration , its show the 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 is %firstNum%
)
if %secondNum% NEQ -99 (
    :2input
    set /p secondNum="Enter second Numer"
    echo second number is %secondNum%
    if %secondNum% == 0  ( goto :2input )
)
goto :while
MichaelS
  • 5,941
  • 6
  • 31
  • 46
507351
  • 1

1 Answers1

1

No idea what you want to achieve with this peace of nonsense but if you want your values to chenge you have to add SETLOCAL ENABLEDELAYEDEXPANSION at the beginning of your code and call your variables as !variable! instead of %variable%.

MichaelS
  • 5,941
  • 6
  • 31
  • 46
  • sorry bro next time i will try to ask you first "may i share my code here or not?" but thanks , it works – 507351 Jul 02 '15 at 08:13