I have the following code to read how long a variable is by echoing it into a file, than reading the file length:
echo %scor% > scorfile.txt
FOR %%? IN (scorfile.txt) DO ( SET /A scorlength=%%~z? - 2 )
if %scorlength%==12 set /a scorlength=1
del /Q scorfile.txt
echo %scorlength%
pause
It believes the variable is an extra character long, and when I open scorfile.txt, there is an extra line, and I believe this is what is causing the problem. How do I fix this? Thanks!