Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

pdir returns diff results between tcc and tcmd - one is an error msg

Aug
21
0
I have an alias named 'new'. It's purpose is to display the newest files in a directory, similar to *dir /podr, but it displays only enough to fill half the screen. This way I can issue commands to the newest files and still see the list. The problem I am seeing is that it works fine in TCC, but errors out in Take Command. The version I am on is 24.00.35 x64, Windows 10 17134.

The alias is:
alias new=pdir /a: /d /odr /Nm:%@eval[%_rows/2] /(dy.m.d th:m:sd zc a fn) %$

In TCC, the output would look something like this:

C:\zips\p2p\JPSoft\pdir> new
2019.02.15 13:22:49.164 5,700 A__________ pf.txt
2019.02.15 13:15:53.977 1,178 A__________ pd.btm
2019.02.09 13:48:53.251 13,479 A__________ 51750004_10213307498738858_1901841561965035520_n.jpg
2018.01.29 11:34:00.841 221 A__________ SLC_DC-3_01_29081966_1280a.txt
2017.10.13 23:11:30.171 226 A__________ 22459100_1528780607158807_1227950967181260792_o.txt
2017.06.25 15:09:46.763 23,040 A__________ gettags_mingw.exe
2015.09.14 16:09:19.994 777 A__________ setendlocalset.cmd
2015.06.10 12:37:48.865 40,359 A__________ ShowVer.zip
2013.06.07 15:14:59.892 225 A__________ ip.vbs
2010.12.13 14:54:00.000 382 A__________ stripTimeStamp.btm


In TCMD, I simply get this:

C:\zips\p2p\JPSoft\pdir> new
TCC: (Sys) The parameter is incorrect.
".5"
Usage : PDIR [/(...) /A[[:][-][+]rhsdaecjot] /D /H /HL /I"text" /KM /N[defjlv] /O[[:][-]adeginorsux] /P /Q /Sn /T[:acw]] [file...]


Any ideas?

Many thanks!
Gary
 
The alias works okay under TCMD on my system, Version 24.01.41 x64 Windows 7 [Version 6.1.7601]

Joe
 
Odd number of rows in your Take Command tab window, but an even number in your console window?
 
.... Yeah. Where you have
Code:
/Nm:%@eval[%_rows/2]

Change it to
Code:
/Nm:%@int[%_rows/2]
 
Or change %@eval[%_rows/2] to %@eval[%_rows\2]. The backward slash gives integer division.
 

Similar threads

Back
Top