Search found 917 matches

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

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

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

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 ...
by jeb
26 Jan 2018 01:27
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 42
Views: 10378

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

1) Should phases 3 and 4 be reversed? The echoing of parsed commands (phase 3) occurs at two points: after the initial round of phase 2 (main parser), and then again after each round of phase 4 (FOR variable expansion for each DO iteration). I think the logic would be much simpler to describe if th...
by jeb
25 Jan 2018 07:56
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 2056

Re: Detect echo state without temporary file

No need for that. Code: Select all for /f "tokens=1,2 delims=: " %%A in ('mode con ^| findstr "Lines Columns"') do set %%A=%%B Okay, that's really simple :o Does that need to be adjusted for language? Also, does the output of ECHO or VERIFY or KEYS change with language? For ECHO it's irrelevant, as...
by jeb
25 Jan 2018 05:56
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 23332

Re: Rules for label names vs GOTO and CALL

Hi Dave, great work :!: But some annotations. When scanning the file for the label name, I see that there are 5 (maybe 6) stop characters for the label name instead of two: <+>, <:>, <space>, <tab>, <LF>, and possibly <CR>. The other token delimiters are not stop characters I retested and I came to ...
by jeb
25 Jan 2018 02:57
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 2056

Re: Detect echo state without temporary file

Very interesting and ingenious, but I think a temp file is both more practical and probably faster. Yes, currently it's only a proof of concept, perhaps it can be improved with other ideas. Your idea is also very good, how to test VERIFY and KEYS, and obviously :D it still can work. You only have t...
by jeb
24 Jan 2018 09:55
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 2056

Detect echo state without temporary file

Until now it wasn't possible to detect the echo state without a temporary file. The main problem is, that fetching the current state doesn't work neither with FOR nor with pipes as both invoke a new cmd.exe instance where the echo state is resetted. The current working solution is to redirect the ou...
by jeb
18 Jan 2018 13:18
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 53
Views: 23332

Re: Rules for label names vs GOTO and CALL

I didn't think of testing it in the command line context. That was an interresting idea. But I get other results than you. Tested on the command line echo Original > out.txt > out.txt :label & dir out.txt I get Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsc...
by jeb
12 Jan 2018 06:59
Forum: DOS Batch Forum
Topic: setlocal enabledelayedexpansion and its potential effect?
Replies: 6
Views: 1901

Re: setlocal enabledelayedexpansion and its potential effect?

Starting a batch from inside a batch file doesn't add a return conetxt onto the call stack. Therefore, when the second batch is exited, normally the batch processing ends. But in this case a command block of a FOR command is used and command blocks are cached in memory and these blocks are never rea...
by jeb
12 Jan 2018 00:04
Forum: DOS Batch Forum
Topic: setlocal enabledelayedexpansion and its potential effect?
Replies: 6
Views: 1901

Re: setlocal enabledelayedexpansion and its potential effect?

You have to CALL your script.
Without CALL the batch context ends and the command line context is enabled.

Code: Select all

Call C:\auto_pkg_build\...
by jeb
03 Jan 2018 06:20
Forum: DOS Batch Forum
Topic: ComSpec strange behaviour
Replies: 12
Views: 4016

Re: ComSpec strange behaviour

It's strange. The default values are only loaded, when the variable is undefined, not when it's only changed to another value. And the pipe loads also the default values for PATHEXT and PATH. For COMSPEC it fails, probably because COMSPEC is needed before the default load function is called. I teste...
by jeb
24 Oct 2017 08:48
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 5300

Re: Closing parenthesis prevents escape of subsequent special character operator

wow This seems to be a new interesting effect of command blocks. Perhaps there are more effects of the following code. Does it affect only the directly following characters or also characters later in the line? (I would like to test it right now, but I'm sitting on a swimming pool the next two week...
by jeb
13 Oct 2017 00:41
Forum: DOS Batch Forum
Topic: How to move cursor upwards without cls?
Replies: 21
Views: 4814

Re: How to move cursor upwards without cls?

Hi,

I tried Aacini's code and it works (Win7 x64), but only when the screen width is set to 80.

When you modify the last SET then it works independent of the screen width.

Code: Select all

 set ... ^& set /P "=.%TAB%%BS%%BS%%%C"
by jeb
13 Sep 2017 11:18
Forum: DOS Batch Forum
Topic: Variable expansion inside :: comments?
Replies: 10
Views: 2622

Re: Variable expansion inside :: comments?

However, it don't works... I also tested all possible errors described in this thread, but none of them leave Delayed Expansion on... Windows 8.1 here. I retested it with Win7 and found that this only works when a call is involved. @echo off setlocal EnableDelayedExpansion call :func :func rem %~ M...