Page 1 of 1

additional internal commands for sort orders

Posted: 2010-06-07, 19:53 UTC
by JustAnotherTCUser
hi,

there are commands like cm_SrcSortByCol1.
these toggle the sort order if column is already sorted.

for better handling sort orders by plugins, what about a set of new commands like cm_SrcSortByCol1Asc & cm_SrcSortByColDesc ?

integrating should be a simple task... ;-)

regards

Posted: 2010-06-08, 07:28 UTC
by solid
Just invoke the command another time and that will reverse the current sort order.

Posted: 2010-06-08, 09:10 UTC
by Balderstrom
Or use TCMC.exe ...

Code: Select all

button8=%Commander_Path%\wcmIcons.dll,52
cmd8=%TCMC% CMcm_SrcSortByCol1 CMcm_SrcNegOrder
menu8=Sort Col1 Reversed
Where TCMC has been SET, by the .CMD I use to launch TC.

RunTC.cmd

Code: Select all

@ECHO OFF
SET PATH=%SYS32%;C:\WIN2K;%wuBIN%;%wuBin%\exCMD;%wuBIN%\exDOS;%SYS32%\Wbem
SET TC=%ProgramFiles%\TotalCMD
SET TCmd=%TC%\TotalCMD.exe
SET TCMC=%TC%\TOOLS\TCMC.exe 50
SET APPLOCAL=%USERPROFILE%\Local Settings\Application Data
START "" "%ProgramFiles%\TotalCMD\TotalCMD.exe"

Posted: 2010-06-08, 11:02 UTC
by JustAnotherTCUser
hi,

doesn't work as expected.
both commands toggle the sort order if this column is already sorted.

the only way i know to get a defined state is, sorting any other column and then sort the desired column.

but that's only a unsatisfying workaround...

regards

Posted: 2010-06-08, 14:18 UTC
by Balderstrom
AH, Would need to Unsort first then.

Code: Select all

button8=%Commander_Path%\wcmIcons.dll,52 
cmd8=%TCMC% CMcm_Unsorted CMcm_SrcSortByCol1 CMcm_SrcNegOrder 
menu8=Sort Col1 Reversed

Posted: 2010-06-08, 14:22 UTC
by MVV
Balderstrom wrote:AH, Would need to Unsort first then.
The problem is that this will add another sort change. It may have much time to change sort method triple.

Posted: 2017-08-07, 05:30 UTC
by byblo
Having the same frustrating problem.

If using the cm_SrcSortByCol1 while it is already sorted, will toggle the sort direction :(

I strongly support the OP suggestion:
adding a new cm_SrcSortByCol1Asc & cm_SrcSortByCol1Desc, cm_SrcSortByCol2Asc ect... would be perfect and natural to use.

Posted: 2017-08-07, 13:48 UTC
by ghisler(Author)
Have you tried to chain 2 commands, e.g.
cm_SrcUnsorted,cm_SrcSortByCol1
or 3:
cm_SrcUnsorted,cm_SrcSortByCol1,cm_SrcSortByCol1

Posted: 2017-08-07, 15:19 UTC
by MVV
ghisler(Author),
It will be too slow in large folders...

Posted: 2017-08-07, 17:03 UTC
by petermad
I strongly support the OP suggestion:
adding a new cm_SrcSortByCol1Asc & cm_SrcSortByCol1Desc, cm_SrcSortByCol2Asc ect... would be perfect and natural to use.
It should rather be implemented the same way as it if for the other sort functions - with a parameter:

history.txt
20.09.16 Added: The following internal commands now accept parameters 0 (toggle, default), 1 (true), and 2 (false), except in main menu (* stands for LEFT, RIGHT, and SRC): CM_VERTICALPANELS,CM_*THUMBS,CM_*BYNAME,CM_*BYEXT,CM_*BYSIZE,CM_*BYDATETIME,CM_*NEGORDER (32/64)

Posted: 2017-08-13, 07:31 UTC
by byblo
ghisler(Author) wrote:Have you tried to chain 2 commands, e.g.
cm_SrcUnsorted,cm_SrcSortByCol1
or 3:
cm_SrcUnsorted,cm_SrcSortByCol1,cm_SrcSortByCol1
Yes doing something similar as workaround: cm_SrcSortByCol2,cm_SrcSortByCol1

Posted: 2017-08-14, 14:22 UTC
by ghisler(Author)
You should only sort by custom column as the last command - it's considerably slower than sorting by internal values like name or size. So better use
cm_SrcUnsorted,cm_SrcSortByCol1