0
Good afternoon. I was making a simple batch file, in general, a friend of mine needed me to do that puzzle of 3 gallons of batch water (8, 5 and 3 liter gallons) In general the batch logic is very simple, but it is with a problem in comparison, where there is the line:
set /A VARIAVELVASO3NO1=%CONTEUDOVASO3%-%QUANTIDADELIVREVASO1%+10
if "%VARIAVELVASO3NO1%" GEQ "10" (
set/a CONTEUDOVASO3=%CONTEUDOVASO3%-%QUANTIDADELIVREVASO1%
set/a CONTEUDOVASO1=8
goto JOGOVASOS
) ELSE (
set/a CONTEUDOVASO1=%CONTEUDOVASO3%+%CONTEUDOVASO1%
set/a CONTEUDOVASO3=0
goto JOGOVASOS
)
The value %VARIAVELVASO3NO1% is 8, since %CONTEUDOVASO3% is 3; and %QUANTIDADELIVREVASO1% is 5 (3-5+10=8). However, instead of entering the FALSE state (which would be the ELSE) he enters the first, which is the TRUE state, I first thought it was a problem with negative numbers, so I put everything above 10 (so the +10 in the formula) but still the problem persists, any idea what it might be?
Have you tried without the quotation marks? if %VARIAVELVASO3NO1% GEQ 10 (
– Murillo Goulart
That’s all, I can’t believe I spent an hour trying to solve the two-quote problem, thank you very much man!
– Darius da costa
Can you accept the answer below then? Thanks!
– Murillo Goulart