Thanks ... that's exactly what I have found out in the meantime. Extension:Scribunto/Lua reference manual#frame.args does contain the hint ... it is just a bit hidden. And I have mostly fixed the problem. I can seize a "private next function"
<code>
funnext = pairs (vartmp) ; -- keep 1 result and throw away 2
</code>
and call it instead of the unusable official "next". But there is a mystery left: what is the syntax of this function? I tried both with the table name
<code>nextindex = funnext (vartmp, nil) -- seize 0:th index
nextindex = funnext (vartmp) -- seize 0:th index
nextindex = funnext (vartmp, thisindex) -- seize next index
</code>
and without
<code>
nextindex = funnext (nil) -- seize 0:th index
nextindex = funnext () -- seize 0:th index
nextindex = funnext (thisindex) -- seize next index
</code>
and the chocker is that both do work, How is this possible? What syntax is preferable?