Very useful, happened to need something like this just this week and by now using it in 3 different scripts. I vote for inclusion in the UDF lib