I'm trying to use local variables in a function but it doesn't work as expected.
@echo off
setlocal
call :Sum %1, %2, sum
echo %sum%
exit /b 0
:Sum
setlocal
set "a=%~1"
set "b=%~2"
set /a "%~3=%a%+%b%"
endlocal
exit /b 0
Here is the invocation of the script:
>test.bat 1 2
ECHO is off.
Any clues?