zdarma, good that you saw it working.
anyway, you asked at the beginning how to shorten the code, didn't you?

and there has been shown multiple ways which are shorter than with udfs...
I must wonder again why you picked it...

anyway, your choice.
_________________________
!

download KiXnet