Why won't this work?
Code: Select all
@set "a=@set "
%a%1=TEST
%a%b=ING
@echo %1%%b%
::The result SHOULD be "TESTING", but no, for it is only "ING"
So my question is why?
I ran into this in C# where I couldn't set a variable starting with a number.
Moderator: DosItHelp
Code: Select all
@set "a=@set "
%a%1=TEST
%a%b=ING
@echo %1%%b%
::The result SHOULD be "TESTING", but no, for it is only "ING"
SirJosh3917 wrote:I'm being weird only for fun in this scenario and I came across this weird thing:
Why won't this work?Code: Select all
@set "a=@set "
%a%1=TEST
%a%b=ING
@echo %1%%b%
::The result SHOULD be "TESTING", but no, for it is only "ING"
So my question is why?
I ran into this in C# where I couldn't set a variable starting with a number.
Code: Select all
setlocal enabledelayedexpansion
@set "a=@set "
%a%1=TEST
%a%b=ING
@echo %1%%b% & rem echo %b
@echo !1!%b% & echo TESTING
@echo !1!!b! & echo TESTING