lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


 Hi
 
Quick question on a custom table sort.
 
I have a custom sort function working correctly  e.g.  table.sort(myTab, customCompareFunc)
 
Then I thought I would like the option of sorting in ascending or descending directions, so I would need to pass in a dirn argument into my
custom sort function.  I cant see how I could do that unless it was a nasty global. 
Is there an elegant way to pass in an argument to the customCompare ?
 
Thanks for any tips
 
Geoff