Actually, that's what I intended to do, ruzam. And that's what I said I was going to do.
One example, of one possible interpretation of the OP's question, was all I wanted to provide.
My bad, sorry. You're absolutely right and I should have read your response more carefully. I'm afraid I got caught up in the code example without paying attention to the lead in.