Search found 914 matches

by jeb
09 Apr 2018 00:46
Forum: DOS Batch Forum
Topic: Pure Batch Colored Bouncing ball animation
Replies: 19
Views: 3742

Re: Pure Batch Colored Bouncing ball animation

Dave, I have use the code above, (select all and copied to a new file named BALLS.BAT) , and have tried it with both of the exact option sets you provided too, neither of them displays animations as above! Here's the output from the first of your examples I'm using Win7, to get it working I open it...
by jeb
08 Mar 2018 01:55
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 22962

Re: Rules for label names vs GOTO and CALL

I may have fooled myself into thinking there is a Win10 difference. But I have discovered the trigger that causes the label with an odd character in position 1 to fail. If the batch script uses \n line terminators instead of \r\n, then I get the weird behavior on Win10. I haven't had a chance to do...
by jeb
07 Mar 2018 16:28
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 22962

Re: Rules for label names vs GOTO and CALL

By far my "favorite" strategy is the definition of the colon variable, as the label name only appears once on the line. All well and good. But then I tested on a Windows 10 machine and both self calls fail I did limited testing, and it appears that on Windows 10, a label with an odd character in po...
by jeb
27 Feb 2018 03:04
Forum: DOS Batch Forum
Topic: Why REM inside a block?
Replies: 14
Views: 3308

Re: Why REM inside a block?

On the other hand, FOR / F loops can produce Errorlevel 1 if an OR condition is appended. That's cool :D :idea: I tested OR and AND with IF and parenthesis and I also tested FOR, but not in the right combination to find your solution. :( Using CALL to set the errorlevel to 1 takes about 7/10 of the...
by jeb
26 Feb 2018 08:55
Forum: DOS Batch Forum
Topic: Why REM inside a block?
Replies: 14
Views: 3308

Re: Why REM inside a block?

Hi pieh-ejdsch,

looks good, ... until I checked the errorlevel :(

Code: Select all

(call)
echo err=%errorlevel%
if 1==1 @
echo err=%errorlevel%
if not 1==1 @
echo err=%errorlevel%
if 1==2 @
echo err=%errorlevel%
Output wrote:err=1
err=1
err=1
err=1
"IF" is fast, but doesn't affect the errorlevel at all
by jeb
19 Feb 2018 16:33
Forum: DOS Batch Forum
Topic: split string into substrings based on delimiter
Replies: 37
Views: 22345

Re: split string into substrings based on delimiter

Hi Aacini,

really nice :!: :D
It takes a minute to understand your code :idea:

Once upon a time, someone told me, that it's nice to explain a bit more and ever after I tried hard. :D

I suppose for some readers it would be helpful, when you show your idea.

jeb
by jeb
06 Feb 2018 04:09
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

3) The odd phase 7 ECHO behavior that jeb discovered regarding <LF> <CR> and <NBSP> does not work on all machines :shock: :evil: For this discussion, I will call the odd behavior "Extended ECHO" I tested jeb's script on 3 machines, and I was only able to reproduce his Extended ECHO results on one o...
by jeb
02 Feb 2018 01:55
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

Your !var:~,7! expansion is broken because you forgot to escape the comma, so the expression is split between the command token and the arguments token in phase 2. Exactly that was my intention, to simply detect, if the character between ECHO and !var is a phase 2 delimiter. This led me to discover...
by jeb
31 Jan 2018 16:19
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

I don't understand why MS wrote cmd.exe that way. But my rules do predict the behavior. Yes, the rules seem to be accurate to explain how it works. But I can't believe that a sane human would code it that way. I suppose, that the behaviour is only a side effect of some parts we currently don't know...
by jeb
31 Jan 2018 13:12
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

Good point I pretty much concluded the same thing at Re: ECHO. FAILS to give text or blank line - Instead use ECHO/ dbenham wrote: When ECHO sees ;/? or ,/? or =/? it sees a token delimiter and then a string beginning with help option. So it prints help. But (/? does not start with a token delimiter...
by jeb
31 Jan 2018 12:12
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

Now when it's clear, I found also some examples to demonstrate the token splitting even without debug mode. @echo off setlocal EnableDelayedExpansion set var=##### echo]!var! ^^^^ #1 echo(!var! ^^^^ #2 ##### ^^ #1 ##### ^ #2 In the first example the carets are only reduced by phase 2, but not by pha...
by jeb
31 Jan 2018 10:45
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

Thanks penpen for the idea to test with the debug mode. I tested it with echo ###1 echo(###2 echo (###3 echo[###4 echo=###5 I only show the relevant parts Cmd: echo Type: 0 Args: ` ###1' Cmd: echo Type: 0 Args: `(###2' Cmd: echo Type: 0 Args: ` (###3' Cmd: echo[###4 Type: 0 Cmd: echo Type: 0 Args: `...
by jeb
30 Jan 2018 09:37
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 83790

Re: ECHO. FAILS to give text or blank line - Instead use ECHO/

A safe character to follow ECHO should be any token delimiter that is not white space. That leads me to predict that all of the following should be good: Code: Select all echo( echo= echo, echo; But ( is only a command Quite a nice try :wink:, but not safe for content. echo(/? echo=/? echo,/? echo;...
by jeb
30 Jan 2018 05:58
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

One critical thing I have discovered about phase 2 - A left paren ( functions as a token delimiter when parsing the command token :!: Yes, I know and I suppose I wrote something about that fact, as I assume that "echo(" got his special abillities from exactly there. The next test works with "ECHO["...
by jeb
30 Jan 2018 02:40
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10094

Re: Discussion about jeb's batch parsing rules on StackOverflow

dbenham wrote: ↑ Fri Jan 26, 2018 2:29 pm Did jeb get this wrong :?: Or does the behavior described by jeb only apply to Win XP :?: Or ... :?: :? I tested the above with (a virtual machine) WinXP, SP3, x86: There the behaviour is as jeb described. I get different results than penpen. I retested it ...