|
Joined: Aug 2006
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: Aug 2006
Posts: 12 |
is there a reason when i use this
noop $finddir(%path,*,0,5,@window)
it lists them in order but when i use
noop $finddir(%path,*,0,5,echo $1-)
its not
|
|
|
|
Joined: Feb 2005
Posts: 342
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 342 |
Yes, because the @window is a sorted listbox. I'm assuming you pulled that out of my example of: alias dirview {
var %i = 1 , %path = $qt($iif($1-,$1-,$$sdir($mircdir)))
window -hesl @dirview | clear @dirview
noop $finddir(%path,*,0,5,@dirview)
window -aw3 @dirview
} /window -hesl @dirview; creates a "sorted" @dirview window, while $finddir(%path,*,0,5,@dirview) populates the window (using 5 as the depth to search for dirs)
|
|
|
|
Joined: Aug 2006
Posts: 12
Pikka bird
|
OP
Pikka bird
Joined: Aug 2006
Posts: 12 |
so that is the only way to list it ordered
okay then
|
|
|
|
Joined: Feb 2005
Posts: 342
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 342 |
Not entirely. Though it's the easiest way in mIRC to do it.
It doesn't -have- to be a list box.
//window -aes @sort | noop $finddir(C:\,*,0,5,aline @sort $1-)
Though -s on the window does need to be specified to make it auto sort things. And aline needs to be used in order for it to be sorted in the @window.
Also, if you already have a file with a bunch of names, you can do something like:
/run sort FILE1.txt > FILE2.txt
Which will copy FILE1.txt into FILE2.txt, but it will "sort" the text in the file.
|
|
|
|
Joined: Jul 2006
Posts: 248
Fjord artisan
|
Fjord artisan
Joined: Jul 2006
Posts: 248 |
Anyone know a way to sort the dirlist based on date? Id like to get for example 10 latest dirs and ignore the rest.
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
$file(foldername).ctime returns the creation date in ctime
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
I'd recommend writing the creation date to the window, then using /filter to filter it. You can then remove the date and anything over your limit of 10 from the window. Or, if you want to make it even easier, use 2 windows, with the first one hidden. Write the folder and date in one window, then /filter. Then, copy the first 10 lines (minus date) to the second window.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2006
Posts: 248
Fjord artisan
|
Fjord artisan
Joined: Jul 2006
Posts: 248 |
Ya thanks for the suggestions, the $file thingie i overlooked 5x i guess ;/ maybe im wanking too much 8)
|
|
|
|
Joined: Jan 2004
Posts: 2,127
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 2,127 |
If there's a possibility a folder will have a date prior to Sept 8th 2001, you should use $base($file(foldername).ctime,10,10,10) to provide leading zeroes to ensure you don't have the oldest folders sorting to the bottom like:
1182700000 999999999
...as a sorted window sees the numbers as if they're text, and sorts 111 before 99 because of the leading '9'.
|
|
|
|
|