Search found 859 matches

by jeb
18 May 2018 02:24
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 2301

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

Related to a comment from aschipf at stackoverflow: Phase 7.1: I think it would be worth mentioning that for the special set semantics set "name=content" ignored the command extensions need to be enabled, otherwise a syntax error arises: what do you think, @dbenham or @jeb? In my opinion, the SET-sy...
by jeb
19 Apr 2018 13:15
Forum: DOS Batch Forum
Topic: Strange for loop behaviour
Replies: 3
Views: 145

Re: Strange for loop behaviour

Hi penpen, I'm a bit puzzeled about what result you expect. :?: I'm not really surprised, that you always get i=1 I simplyfy your code a bit, trying to build a minimal example. I first removed the timestamp stuff and the variable x and also the %% 4 set "loadColors=(set "i=0" & (for %%a in (!table!)...
by jeb
16 Apr 2018 17:39
Forum: DOS Batch Forum
Topic: Parallax background, and overlapping images properly
Replies: 11
Views: 380

Re: Parallax background, and overlapping images properly

I used your sample files cloud1.ppm and mountain1.ppm. This batch demo shows that you can overlay two different images in real time (7 FPS). I'm using pre cached files to avoid the long converting time from RGB to escape sequences. And for combining two images, I precompute a run length encoded arra...
by jeb
16 Apr 2018 09:50
Forum: DOS Batch Forum
Topic: Parallax background, and overlapping images properly
Replies: 11
Views: 380

Re: Parallax background, and overlapping images properly

Hi Icarus,

do you can put your ppm files somewhere, so we can play with them?
by jeb
16 Apr 2018 09:46
Forum: DOS Batch Forum
Topic: Convert R G B values into single 0 - 255 color value?
Replies: 18
Views: 626

Re: Convert R G B values into single 0 - 255 color value?

Hi, I played a bit with your code. I tried to optimize the display function, I precompute all escape sequences before the display function is called. I used the tip of Dave to use certutil. This should be fast enough for a game. Only the RGB-converting time is slow (takes 7seconds on my pc) Now the ...
by jeb
09 Apr 2018 00:46
Forum: DOS Batch Forum
Topic: Pure Batch Colored Bouncing ball animation
Replies: 19
Views: 850

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: 13187

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: 13187

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: 785

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: 785

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: 35
Views: 11086

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: 2301

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: 2301

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: 2301

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: 2301

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...