Re: Bug in CMD.exe? Parentheses confused
- From: Rich Pasco <richp1234@xxxxxxxxxxx>
- Date: Fri, 09 Feb 2007 11:23:15 -0500
Thanks.
Also you the numbers in set statement arithmetic must be interger, not
decimal fractions.
This works:
set /a sum=2+2
This doesn't:
set /a sum=2.1+2.2
- Rich
Eman wrote:
It's not out of place to escape all suspect.
on the right of the "set something=" statement.
E.g., this would work:
~~
@echo off
if 1==1 (
set /a result = 2*^(3+4^)
)
echo result=%result%
~~
And this one too:
~~
@echo off
if 1==1 (
set /a result =^ ^2^*^(^3^+^4^)
)
echo result=%result%
~~
- References:
- Bug in CMD.exe? Parentheses confused
- From: Rich Pasco
- Re: Bug in CMD.exe? Parentheses confused
- From: Eman
- Bug in CMD.exe? Parentheses confused
- Prev by Date: Re: Bug in CMD.exe? Parentheses confused
- Next by Date: Re: Bug in CMD.exe? Parentheses confused
- Previous by thread: Re: Bug in CMD.exe? Parentheses confused
- Next by thread: Re: Bug in CMD.exe? Parentheses confused
- Index(es):
Loading