Archive: Locate and sort


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!)


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


NSISList_plug-in provides a sort function too. Only ANSI version available currently though...


thank you, will give nsArray a try - also since it comes at only 1/3 of the size of the locate plugin :)


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


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!

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.


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...


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