Old 10th October 2011, 14:42   #1
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Locate and sort

as discussed elsewhere, i'm having stability problems using the locate plugin. i startet porting portions of my script back to the locate function until i ran into the reason why i was using the plugin in the first place: sorting. now i'm sure there are ways of addressing this when using the function, but i wouldn't know how - any tips are welcome.

i'm trying to write a file-structure (files and directories) into a text file (and no, i don't want to go back to the dir command either!)
Yathosho is offline   Reply With Quote
Old 10th October 2011, 16:35   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
How about filling a nsArray using the standard Find* instructions and sorting that? If you need to figure out why something is crashing you might need to run it through the debugger in VS.

Stu
Afrow UK is offline   Reply With Quote
Old 10th October 2011, 17:10   #3
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
NSISList_plug-in provides a sort function too. Only ANSI version available currently though...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 11th October 2011, 07:23   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
thank you, will give nsArray a try - also since it comes at only 1/3 of the size of the locate plugin
Yathosho is offline   Reply With Quote
Old 11th October 2011, 12:31   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I've added NSISList to the arrays page: http://nsis.sourceforge.net/Arrays_in_NSIS
Also LoRd_MuldeR, you are missing PageAuthor from your plug-in's page. Not sure if this is intentional, but just add {{PageAuthor|[username]}} to the top if you want.

Stu
Afrow UK is offline   Reply With Quote
Old 11th October 2011, 12:47   #6
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Afrow UK View Post
Also LoRd_MuldeR, you are missing PageAuthor from your plug-in's page. Not sure if this is intentional, but just add {{PageAuthor|[username]}} to the top if you want.
Didn't know about that one. Will add now. Thx!

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 12th October 2011, 12:16   #7
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
i don't understand how the sort function is of any help in my case. i can output the sorted values as a string only, but i will easily exceed the strlen when using an array with directory names. sorting is of no help when looping through the array, as the index will remain the same.
Yathosho is offline   Reply With Quote
Old 12th October 2011, 12:42   #8
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Not sure abot nsArray, but NSISList will definitely re-order the items in the array/list when sorting.

So you can loop through the sorted array and process one item each time...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 12th October 2011, 13:49   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
Originally Posted by Yathosho View Post
i don't understand how the sort function is of any help in my case. i can output the sorted values as a string only, but i will easily exceed the strlen when using an array with directory names. sorting is of no help when looping through the array, as the index will remain the same.
Ah yes I didn't think about that when I changed the plug-in to use hashing. I will add a GetAt function for getting an element at a given index.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
locate, sort, sorting, structure

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump