I'm only partially grasping how far you can go with user declared variables. Should have looked more closely.
I was struck by
$pos++ which reminded me of regex. I know you can use ++ e.g.
for( $n = 0; $n < $items; $n++ )but your use here makes me see this functionality has much broader application than I had been considering.
($text[$pos]," ")I wasn't sure that you could (or how to) add a "<value>" that related to [$pos] - that was something I needed to find out, as you must realize.
There must be a lot of flexible utility in the scripting forms which I don't yet perceive. You have made me look at the possibilities of creating unique 'tools' as variables within the framework. I hadn't seen this part of the pattern, semantically speaking. I'm not thinking
big enough in that sense.
What I recall of Basic, was very restricted in comparison. I have been thinking in those terms & looking for a specific pre-made tool. This is more granular & I think actually allows me a lot more freedom than Basic ever could have done.
Hopefully I will have a few hours to look at all this again tomorrow. Need to study each step a few times, then experiment a bit.
Lots of possibilities, so thanks for the lesson Mathias.