Thanks for getting back to me.
I tried something similar with 'undefined' but it didn't work. I think the sticking point is an empty array, which is not undefined.
The following works perfectly:
Code: Select all
while ( col.length ) AddSortByNumber(tbl,col.pop());
if ((col instanceof Array) || isNaN(col)) return;
//this is the actual name of my procedure
I like this method - it's neater than checking for an array or number and then looping through the array. There is an overhead with recursion
but this procedure works with table columns and there will never be a huge number of them.
Thanks again, Andy.
(P.S. it's nice to have an example of recursion which isn't a
Edited: Fibonacci series
)
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.