Documentation @LINE[CON,n] @LINES[CON] not documented (bug?)

Jan 22, 2009
10
0
The only help-file example of using @LINE on redirected standard input is
(echo %@line[con,0]) < myfile.dat​
which does work.

However, the assumption is that, if myfile.dat is, forexample:
a​
b​
c​
, then
(echo 0=%@line[con,0] 1=%@line[con,1] 2=%@line[con,2]) < myfile.dat​
"should" echo
0=a 1=b 2=c​
. Instead it echos (bug??)
0=a 1=c 2=**EOF**​
. It should be documented that the way to make this example work is:
(echo 0=%@line[con,0] 1=%@line[con,0] 2=%@line[con,0]) < myfile.dat​
0=a 1=b 2=c​
. Apparently STDIN cannot be "rewound" after being accessed. This means that @LINES[CON] can never be used because it "consumes" all of STDIN.

Therefore, here's an example to process STDIN in a batch file:
set i=-1
do until "%[linecon%i]" == "**EOF**"​
set i=%@INC[%i]
set linecon%i=%@LINE[CON,0]
enddo
set linecon%i=
set linescon=%@DEC[%i]​
 
May 31, 2008
382
2
Can one use @FILEREAD to read stdin? The issue is how to get stdin's file descriptor - using the 'intuitive' (for linux) 0 doesn't work.

OT, I remember having seen a 4NT [sic] plugin that provides a specialized console read function, but I can't trace that plugin anymore. Does anyone know?
 
Jan 22, 2009
10
0
I think the documentation for @LINE , @LINES , and @FILEOPEN should be updated based on this thread.
 
Similar threads
Thread starter Title Forum Replies Date
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
Peter Murschall Single-line Do-CMD is a bit uncooperative. Support 6
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
J How to? max. practical command line length? Support 3
mfarah WAD Odd behaviour with command-line arguments on TCMD. Support 7
T Regex engine doesn't recognize native DOS line endings Support 2
thorntonpg F1 on command line The webpage cannot be found Support 5
J Python: TCC command line parsing removes '=' equal sign characters Support 4
L Fixed console line length in Take Command 19? Support 3
C LOG entry for TCMD/TCC command line Support 15
fpefpe Documentation Can the title line of tcmd be set? Support 4
H command line parsing question Support 5
dcantor How to make line numbers fixed width in FFIND Support 11

Similar threads