jens, there is a buggie boo in your atrim()
I think it's caused by the explicit which it does not apply.

moving my UDF up over it makes it work fine again.
and here is the test engine:
kixgolf test engine
_________________________
!

download KiXnet