View Single Post
03/24/15, 04:46 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,043
For me it looks that your function GetSearchResults() will build up a new table with the values of ALL your textues and paths that match to the searched string.
But you'll build a table "searchResults " with non-digit keys here!
Or does your table TEXTUREIT_TEXTURES store the key as digits? It looks like you are using text "name of texture" = texture "path to texture"?

The function table.sort will only sort, as far as I know, tables with non-alphanumeric key values. Only digits work properly.
I guess you'll have to transfer your searchResults table into another table with digits as key and then sort it by your sortfunction and afterwards transfer the results back to your wished output table.

Maybe this helps although I'm not sure if this explains the NIL stuff somehow ^^
  Reply With Quote