I had a look at 2D array. They are not easy and I stepped in a few beartraps and maybe I even need some new functions to handle them easier.
Some things are easier to archive but it is a lot to learn and test.
Update: I have converted it from array with a key to a 2D array. Work great and it was a few hours checking and finding out how to use it. Thanks for pointing me in the right direction.
I had one problem of appending to the 2D array but thanks to this posting that is not tackled also:
viewtopic.php?p=819886#p728850
Example transfering specific item from one 2D to an other 2D:
:foreach label,v in=$arrayLabel2D do={:set $arrayDisplay2D ($arrayDisplay2D , {($arrayLabel2D->$label->1),""}) };
This appends a item and adds also a empty item so that later it can be used. I use :foreach to have a stop at the end of the source array and $label is then just a counter. This because there are not keys in the array.
:foreach has become my favorite script command by now, it is so flexible. The $v contains the two items in a array part separated by ";" it is just bonus that can be used in other ways like moving two item in one go, to the destination array.
:global arrayDisplay2D [:toarray ""]; :foreach label,v in=$arrayLabel2D do={:set $arrayDisplay2D ($arrayDisplay2D , {$v}) }
The Wiki could contain so much more examples and it saves users a lot of time trying and searching.
Nice to find these
gems.