Yathosho
10th October 2011 14:42 UTC
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!)
Afrow UK
10th October 2011 16:35 UTC
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
LoRd_MuldeR
10th October 2011 17:10 UTC
NSISList_plug-in provides a sort function too. Only ANSI version available currently though...
Yathosho
11th October 2011 07:23 UTC
thank you, will give nsArray a try - also since it comes at only 1/3 of the size of the locate plugin :)
Afrow UK
11th October 2011 12:31 UTC
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
LoRd_MuldeR
11th October 2011 12:47 UTC
Originally posted by Afrow UK
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!
Yathosho
12th October 2011 12:16 UTC
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.
LoRd_MuldeR
12th October 2011 12:42 UTC
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...
Afrow UK
12th October 2011 13:49 UTC
Originally posted by Yathosho
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