How to understand `@rowindex` in context of a list-triggered roster?

For list-triggered rosters, I understand that @rowcode is the unique count number. For each new element added to a list, a new @rowcode value is created. For example, if one enters “One” in as the first entry in a list and “Two” in as the second entry, those entries will have @rowcode values of 1 and 2, respectively, in the list-triggered roster linked to this list question. If “Two” is deleted and “Three” added, then “Three” will have @rowcode value 3.

In this same context, what values will @rowindex assume? In particular:

  • Is @rowindex, as its name suggests, a zero-based index?
  • Do its values run continuously, without discontinuity, from 0 to N-1, where N is the number of list entries?

(Note: I searched the documentation and only found mention of @rowindex here. Happy to contribute a description to the docs once this myster is solved for me.)

@rowindex is the dynamic, zero-based position of a row in a roster, while @rowcode is a permanent, unique, system-generated identifier for that row, which carries over the code of the item added to the TextList (the trigger question).

When any items are removed from the TextList that contains them, the Value values for the remaining items are not affected, and hence the @rowcode values for the rows in the rosters remain unaffected.

(Do note however that if the last item is removed from the list, the newly added item may reuse the same code, such as if you add A, B, then remove B, add C. C will get the same Value as B had (in the TextList), and hence it will have the same @rowcode value (in the roster(s)).

Yes, except if your roster has an enabling condition, which may hide some rows (all the disabled/hidden rows are still getting assigned @rowindex values).

Note in this example:

  • there are no gaps in @rowindex values;
  • the first and the last members do not satisfy the roster’s enabling condition (condition itself not shown and not relevant here), and hence they are disabled (but the @rowindex and @rowcode values there are technically allocated, albeit not visible in the screenshot - substitution in the roster header sees them as attributes of a row which doesn’t satisfy the enabling condition - hence missing).
  • the name “SANDRA” was initially entered (and assigned Value 5, but subsequently removed from the members list, hence there is a gap in remaining @rowcode values visible here (between “JESSICA” [4] and “NATALIA” [6]).

PS: in the explanation above I tried to use Value and @rowcode as appropriate for the corresponding class. But it is the same value when the roster is triggered by a list. In the case when a roster is triggered, say, by a numeric question then @rowcode is generated automatically. So any roster will always have @rowcode and @rowindex attributes for its rows, thought for a TextList-question-triggered roster the @rowcode-s will coincide with the Value-s in that TextList-question.