A small change

May 20, 2008
11,400
99
Syracuse, NY, USA
I noticed a small change; I believe it came with the latest update. TASKLIST now identifies the current TCC like this, for example.
Code:
3704  * tcc              14.03  [3704]  v:\
Whereas, in v13 (and I think more recently) it was like this.
Code:
 3492* tcc              13.04  [3492]  v:\
I don't mind where the asterisk goes but I don't like the extra word.

P.S. (a suggestion) Yesterday I was struggling a bit with the WORDS in TASKLIST's output and thought it would be a nice touch if @WORD[] accepted open-ended ranges, like this.
Code:
v:\> echo %@word[1-,My dog has fleas]
dog has fleas  (desired)
where "N-" gives all words from word N on.
If it's already meant to do that, then it doesn't quite get it right.
Code:
v:\> echo %@word[1-,My dog has fleas]
dog has  (actual)
Nor does it do anything consistent.
Code:
v:\> echo %@word[0-,My dog has fleas]
My
v:\> echo %@word[2-,My dog has small fleas today]
has small fleas
It seems if you specify "N-", you get N+1 words starting at word N.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
You can specify %@word[2-9999,string] to specify words 2 through 9999, which displays the rest of string if it has fewer than 9999 words. Admittedly it is not as nice as your suggestion, but you could already do it many versions ago.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
You can specify %@word[2-9999,string] to specify words 2 through 9999, which displays the rest of string if it has fewer than 9999 words. Admittedly it is not as nice as your suggestion, but you could already do it many versions ago.
Yesterday I tried something like that and was convinced it didn't work. This works fine; every line has a WORD_1:
Code:
v:\> do l in /p tasklist ( echo %@word[1,%l] )
[System
System
smss
csrss
*** SNIP ***
But when I ask for words 1-2 (or 1-9999) I don't even get word 1. What's happening here?
Code:
v:\> do l in /p tasklist ( echo %@word[1-2,%l] )
[System Process]
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
taskhost          Task
dwm              DWM
explorer          Program
ECHO is OFF
winpm-32          Pegasus
powerpro          Physimem
OUTLOOK          RE:
ECHO is OFF
firefox          A
* tcc
ECHO is OFF
 
Aug 2, 2011
258
4
Berlin, Germany
The problem seems to be, that the function @word doesn't handle the error which occurs when you use "1-99" or "0-2" but the string has less words than requested.
But otherwise this works:
Code:
echo %@word[4-99,My dog has small fleas today]
No idea.
This is also funny (here I tried it with a textfile):
>do line in @tasklist.txt ( echo %@word[0-2,%line] )
0 [System Process]
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF
1948 vmware-usbarbitrator64
ECHO is OFF
ECHO is OFF
ECHO is OFF
ECHO is OFF

The short lines have trailing spaces, e.g. "123 svchost ".
The long ones do not.
Haha:
Code:
>do line in @tasklist.txt ( echo %@word[0-2,%@trim[%line]] )
0        [System Process]
4        System
344      smss
508      csrss
560      psxss
580      csrss
592      wininit
644      services
676      winlogon
696      lsass
704      lsm
812      svchost
888      svchost
1004    MsMpEng
524      svchost
392      svchost
904      svchost
1104    svchost
1304    svchost
1408    svchost
1532    spoolsv
1580    svchost
1616    svchost
1752    dsAccessService
1848    svchost
1868    svchost
1964    PassThruSvr
2008    svchost
2032    svchost
1136    TCPSVCS
412      USBDLM
1948    vmware-usbarbitrator64
2064    vmnat
2108    vmnetdhcp
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Frank, I think you found the culprit ... separators at the end on the string (see other thread about @WORD).
Code:
v:\> echo %@word[1-9999,PID scvhost]
scvhost
 
v:\> echo %@word[1-9999,PID scvhost ]
ECHO is OFF
 
v:\> echo %@word["-",1-9999,PID-scvhost]
scvhost
 
v:\> echo %@word["-",1-9999,PID-scvhost---]
ECHO is OFF
 
Similar threads
Thread starter Title Forum Replies Date
Alpengreis Small things to change in installer and after installed Everything Support 0
R @select inside alias gives different (insanely small) window Support 7
K_Meinhard Small problem in german IDE 26 Support 3
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
K_Meinhard Small omission Support 2
X small translation error. Support 0
K_Meinhard Very small nit in german Options dialog Support 1
Alpengreis [v21.00.14]A small graphical glitch only ... Support 2
Alpengreis A small cosmetic installer thing ... Support 0
N Popup Window size too small Support 5
E TCC History popups too small Support 0
M WAD A small complaint re. Take Command and file (and particularly directory) handles... Support 21
U Two small inaccuracies in the TC help Support 6
R History window wrong size, can't remember size change Support 12
H Behavior change re piping a string to a Java program Support 1
Alpengreis [FORUM] After change the font, bold is without effect Support 7
R How to? Change TCMD tab font size in window menu Support 3
E How to change window title tcmd window - not tcc window Support 1
Charles Dye File completion change Support 11
T Change language in script Support 4
Jay Sage Change in Behavior of Activate Command Support 4
I Change value of a variable while debugging Support 3
T Change language after installation Support 4
WadeHatler Fixed Breaking change in Expression evaluation (.and.) in v17 Support 6
D Fixed Change in behavior of variable expansion between 16 and 17 Support 3
Peter Bratton Change in scrput behaviour Support 4
A How to? Can't change directory ("cd") into system hidden files Support 13
J Change folder TCC starts in Support 2
ehab aboudaya How to? change ALT-F6 to another key Support 1
S How to? Change thread prefix? Easy "create thread" method? Support 8
S Terminology change Support 2
Peter Bratton @ping behavior change Support 2
T signaling firstcondition and cannot change colors Support 8
newbie Change percent-sign to anything-else in filename Support 24
nikbackm Change format of DIR totals Support 3
Stefano Piccardi did the forum software change in the last two days? Support 2
nikbackm LocalHistory change Support 3

Similar threads