There is more than one way to do it...
Thanks very much for your help (and also for the benchmarking). I did not think that my question would create such a competition ;)
I will need some time to digest some piece of code before understand it, especially the solutions provided by skeeve.