I know this is probably really easy question
I am trying to make a game with MS-DOS.
I need to be able set the number of characters in a variable (PLAYERNAME) into a variable (PLAYERNAMELENGTH)
I try to use this code but it keeps on crashing :
cls
set /p "PLAYERNAME=What is Your In-Game Name? (Must Be Under 10 Characters)?"
set #=%PLAYERNAME%
set PLAYERNAMELENGTH=0
:loop
if defined # (set #=%#:~1%&set /A PLAYERNAMELENGTH += 1& goto loop)
if %PLAYERNAMELENGTH% GTR 10 goto INVALIDPLAYERNAME
if %PLAYERNAMELENGTH% LEQ 0 goto INVALIDPLAYERNAME
goto CITYNAME
It says the syntax of the command is incorrect
Please, Help
I am trying to make a game with MS-DOS.
I need to be able set the number of characters in a variable (PLAYERNAME) into a variable (PLAYERNAMELENGTH)
I try to use this code but it keeps on crashing :
cls
set /p "PLAYERNAME=What is Your In-Game Name? (Must Be Under 10 Characters)?"
set #=%PLAYERNAME%
set PLAYERNAMELENGTH=0
:loop
if defined # (set #=%#:~1%&set /A PLAYERNAMELENGTH += 1& goto loop)
if %PLAYERNAMELENGTH% GTR 10 goto INVALIDPLAYERNAME
if %PLAYERNAMELENGTH% LEQ 0 goto INVALIDPLAYERNAME
goto CITYNAME
It says the syntax of the command is incorrect
Please, Help