Welcome!

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

SignUp Now!

Done @SELECT sort

Aug
1,916
68
From the help file;
Code:
If you set the optional 7th parameter sorted to 1, the list will be sorted alphabetically.

It would be great to allow the sort to be ascending or descending.

To get this;
1602597232428.png


I presently have to do this;
Code:
sort /r %temp\c2p.txt /o %temp\c2p.tmp
del /q %temp\c2p.txt
ren /q %temp\c2p.tmp %temp\c2p.txt
*set results=%@select[%temp\c2p.txt,1,1,20,80,Select a file from the list]

Joe
 
You could do this:
Code:
sort /r %temp/c2p.txt | set results=%@select[con:, 1,1,20,80,Select a file]
 
Yes indeed @samintz , many thanks for that.

That will help now, but would like to see ascending/descending as a future sort option for @select.

Joe
 
Or roll your own ...

Code:
v:\> function rselect `%@exec[@set tmpf=%tmp\%@name[%1].tmp]%@exec[@sort /r %1 /o %tmpf]%@select[%tmpf,%2$]%@exec[@del /q %tmpf]`

v:\> do i=1 to 5 ( echo %i >> 1to5.txt )

v:\> echo %@rselect[v:\1to5.txt,0,0,400,500,pick one]

1602606218509.png
 
You could do this:
Code:
sort /r %temp/c2p.txt | set results=%@select[con:, 1,1,20,80,Select a file]
Better make that an in-process pipe (|!) or RESULTS won't be set in the current instance.
 
@SELECT TCC internal variable function
If you set the optional 7th parameter sort to 1, the list will be sorted alphabetically. If you set sort to -1, the list will be sorted in reverse alphabetic order.

No more need for external sort.exe

Thanks!

Joe
 
Back
Top