mIRC Home    About    Download    Register    News    Help

Print Thread
#156049 11/08/06 04:43 AM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
is there a reason when i use this
Code:
noop $finddir(%path,*,0,5,@window)

it lists them in order but when i use
Code:
noop $finddir(%path,*,0,5,echo $1-)

its not

#156050 11/08/06 04:55 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Yes, because the @window is a sorted listbox.

I'm assuming you pulled that out of my example of:

Code:
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)

#156051 11/08/06 05:10 AM
Joined: Aug 2006
Posts: 12
G
glue Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Aug 2006
Posts: 12
so that is the only way to list it ordered

okay then

#156052 11/08/06 05:39 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
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.

Rand #179535 24/06/07 10:03 AM
Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
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.

bwuser #179536 24/06/07 10:43 AM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
$file(foldername).ctime returns the creation date in ctime

bwuser #179540 24/06/07 02:05 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
5618 #179557 24/06/07 07:33 PM
Joined: Jul 2006
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Ya thanks for the suggestions, the $file thingie i overlooked 5x i guess ;/ maybe im wanking too much 8)

5618 #179605 25/06/07 01:06 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
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'.


Link Copied to Clipboard