Single-line Do-CMD is a bit uncooperative.

I tried to remove some old DOS/CMD-klutches, e.g. replacing Echo. by Echo ``, but
1613577975309.png

That means : Do 5 (Echo.) is working, Echo ``,Screen %_row %_column ^r^n is not.
Why ?
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
There's nothing wrong with using "echo." The other issues seem related to parsing. If you escape the backticks, it works.
Code:
do 5 (echo ^` ^`)
I tried this
Code:
$ do 5 (echo %_row, %_column)
40, 0
40, 0
40, 0
40, 0
40, 0
And if I doubled the percents, it just echoed the text '%_row %_column'
So I don't know how to fix that.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
The ^r^n is disappearing and there is no text for the SCREEN command. If 5 blank lines is what you really want, this works.

1613581995581.png


It's the same with ECHO.

1613582259094.png
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Well, for that matter, this does too:
Code:
echo %@repeat[^n,5]``
Scott, do you have any idea why the `` makes that work when it otherwise fails?

I tried this (below) with somewhat surprising results.

Code:
v:\> echo %@repeat[^^n,5]
^^^
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
My guess is that whitespace is normally stripped from the end of a command line. And the `` says keep all the stuff before it.
Same reason why echo `` works vs echo followed by spaces.
 
My guess is that the DO-command parser goes another way as the other parsers, for example the (peculiar) FOR will work as expected:
Code:
D:\JPSoft\TCC22>:do 7 (Echo ``)
ECHO ist AUS
ECHO ist AUS
ECHO ist AUS
ECHO ist AUS
ECHO ist AUS
ECHO ist AUS
ECHO ist AUS

D:\JPSoft\TCC22>:for /L %var In (1,1,7) Echo ``








D:\JPSoft\TCC22>:
 
Similar threads
Thread starter Title Forum Replies Date
rfaquino How to? Display filename being copied on a single line Support 2
vefatica Single-line DO inside nested multi-line DOs? Support 9
E Scrolling output to single, non-scrolling line Support 13
M Backquoted parameters used in GoSub don't pass string as a single parameter Support 2
A License Question for Single User Support 5
fpefpe How to? Single installer? Support 5
Emilio III Registering TCMD in VM with single license? Support 2
S How to? Installing TCMD for a single language Support 5
C Single Instance not honored? Support 2
S How to? Install single-language version Support 22
E Single instance/TCMD Here problem Support 7
T VIEW only works from command line Support 14
vefatica `Back quotes` - command line vs. batch file Support 5
Phileosophos Is there any way to open the Take Command options dialog from the command line? Support 8
Phileosophos Command-line Editing Shortkeys That Fail Support 6
D How to use multi-line DO to loop through first level directory names Support 5
D Open Windows 10 Photos app from command line Support 11
Jesse Heines Strange Line Wrapping Behavior Support 14
fpefpe How to? command echo in title line/bar Support 2
vefatica Command line DO with no closing parenthesis? Support 9
R Long commands retrieved from command history have blank line when wrapped Support 20
M No line wraps if last line of the screen buffer is reached Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
R CMDebug, dark theme, current line Support 7
vefatica IDE - when breakpoint is on a blank line? Support 3
D Double Quote in TC Tool Bar Button Command line Support 3
Joe Caverly Expand all aliases on the command line Support 2
vefatica How do I do this with a multiple-line DO? Support 7
Jay Sage Cannot Postion Cursor in Command Line Using Mouse Support 7
vefatica Windows 10 and line wrapping selection? Support 6
vefatica IDE.EXE's command line? Support 19
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
D btm file command line augments comparing for string or math. Support 12
D Grabbing html text with @line Support 3
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
vefatica FFIND and multi-line regular expressions Support 4
P Escape key no longer clears command line in v24 Support 21
J File explorer handling from command line? Support 2
M Ctrl-C when using command line history does nothing Support 2
M Command line parsing differences between cmd.exe and TCC Support 6
C Replace 1st argument on command line Support 4
vefatica Library functions and line continuations? Support 4
Joe Caverly Works in debugger, not from cmd line Support 1
P No linefeed on last line of console window Support 2
K Command Line Selection Not Working Support 12
J Error running Python at command line Support 9
Joe Caverly PSHELL Blank Line Display Support 2
rps How to? Alias/Command line use of *log on/off Support 2
x13 //directive ignored on TCC command-line Support 4
Joe Caverly Unicode, Codepage 437, and line characters Support 3

Similar threads