[Solved]leading digit, yet name ends in char [_,.] problem !

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: XP, Vista BUG No leading char, yet name ends in char [_,

#16 Post by alan_b » 01 Nov 2011 03:16

Ed Dyreen wrote:'
DOS tells me, it can't decide whether it is part of a variable because of the underscore at the end.

I have never seen a DOS error message in such "natural human language".
Did you find that in Microsoft documentation ?
Did Microsoft email that information to you ?
I or is this your interpretation ?

Please consider the possibility that '=' has very strange effects.
A very simple DOS operation "abort" within

Code: Select all

21,"DTLite4413-0173.exe","http://mirror07.soft24.com/getfile.php?p=http://disc-tools.com/1bbd44ed68712d32173b0eb376f5d449/DTLite4413-0173.exe","file:///E:/Downloads

should have resulted in identical output but it aborted early, delivering only

Code: Select all

21,"DTLite4413-0173.exe","http://mirror07.soft24.com/getfile.php?p

See my response at Wed Oct 26, 2011 7:14 pm in
viewtopic.php?f=3&t=2368

You have focussed upon '_' but I suspect it might have been the early "abort" of your '_='

Regards
Alan

jeb
Expert
Posts: 1058
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: XP BUG leading digit, yet name ends in char [_,.] !

#17 Post by jeb » 01 Nov 2011 07:06

In my opinion the only problem is that ED's test scenario is too complex,
so the results can't be interpreted. :wink:

I don't understand why you experiment with the command token instead of use simple echo %2variable% :?:

And perhaps it's more advanced to guess what happens, but in my opinion it's much easier to use ECHO ON.

Code: Select all

@echo off
setlocal
set var=content
set 1echo=set
call :test 111
exit /b

:test
echo on
echo %1var%%
echo %1var_%%
@echo off
EXIT /B


And I got the expected results, there is nothing obscure nor undefined behaviour :)

jeb

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: XP BUG leading digit, yet name ends in char [_,.] !

#18 Post by Ed Dyreen » 01 Nov 2011 12:07

'
This is how XP32 SP2 reacts, given the following batch file.
So is my batch on my pc acting different then on yours pc :?: :?: :?:

Code: Select all

@setlocal &prompt $_$G

set "2echo_=echo This causes an error"
%2echo_% See, I told you

set "2echo=echo This works"
%2echo% See, I told you

@pause
@exit /b

Code: Select all

>set "2echo_=echo This causes an error"


>echo_ See, I told you
echo_ wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.


>set "2echo=echo This works"


>echo See, I told you
See, I told you
Druk op een toets om door te gaan. . .
Jeb, what is too complex ?

I tested your code and conclude the same as yall even with different results, not set a variable to begin like a parameter name :?

Code: Select all

@echo off &setlocal &prompt _$

set "2echo_=echo This causes an error"
%2echo_% See, I told you

set "2echo=echo This works"
%2echo% See, I told you

call :test oops
pause
exit /b

:test
echo on
echo %2echo%
echo %2echo_%
%2echo%
%2echo_%
echo off
EXIT /B

Code: Select all

echo_ wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.
See, I told you

_echo echo
echo

_echo echo_
echo_

_echo
ECHO is on (aan).

_echo_
echo_ wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.

_echo off
Druk op een toets om door te gaan. . .
Yes I know jeb, a simple echo would be the best.
But I use echo( instead of echo., because it fails less.
But then echo( won't work in a macro unless you escape the (
And then I sometimes redirects the echos and I am pretty lazy.
That's why I use these macros, cause I'm f**king lazy :)

Code: Select all

set "@21echo_=>con <nul set /p ="

jeb
Expert
Posts: 1058
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: XP BUG leading digit, yet name ends in char [_,.] !

#19 Post by jeb » 01 Nov 2011 14:18

Yes it's all the expected correct behaviour, but your test could be more powerful. :)

Replace call :test oops with call :test oops XXX

Neither the 2echo nor the 2echo_ variables are ever expanded.
Each time the %2 parameter is expanded and the rest echo% and echo_% results in echo and echo_

I can't see any XP-bug nor a difference between XP and Vista

jeb

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: leading digit, yet name ends in char [_,.] problem !

#20 Post by Ed Dyreen » 01 Nov 2011 17:17

'
I see, I must have been drunk, but I wasn't :lol: ,
I'll blaim DRUGS then, or the Catholics. :mrgreen:,
always easier to put the blaim elsewhere :twisted:

jeb
Expert
Posts: 1058
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: leading digit, yet name ends in char [_,.] problem !

#21 Post by jeb » 01 Nov 2011 17:19

Without words :D :)
Ed Dyreen wrote:Jeb, what is too complex ?

Post Reply