I see that you can really improve a lot on this as well. The solution at the beginning of this thread is still sufficient for the purpose for which it was written. I will publish the exact use and the reason why I deal with it soon. It is again just one fragment from a larger program. Thank you all for your many inspiring suggestions!
nejsam to co si myslis, ne, nejsam ja tot