windowHDAnsGetRptNdx Method
This function returns the full set of repeat indexes for the current dialog. When using HDAPI.GetAnswer and HDAPI.SetAnswer with repeated dialogs, this function allows you to get or set the values of variables in the current repetition.

JavaScript API: Direct
Assembly: api.js Version: 1.0.0.0 (1.0.0.0)
Syntax

JavaScript
function HDAnsGetRptNdx();

Return Value

Type: string
The repeat index of the current dialog. This will be a string in the form of "0:-1:-1:-1", where the index at each repeat level is separated by a colon, and -1 is used to represent unused levels of repetition.
Examples

The following example illustrates how JavaScript code running in a popup window (a "server answer source") can retrieve the current repeat index in the interview window from which it was invoked, and use that index to set repeated answers at the appropriate repeat index.
JavaScript
function SetVariables(index)
{
    window.opener.HDAPI.SetAnswer("Employee Name", EmpName[index], window.opener.HDAPI.GetAnswerRepeatIndex());
    window.opener.HDAPI.SetAnswer("Employee Gender", EmpGender[index], window.opener.HDAPI.GetAnswerRepeatIndex());
    window.opener.HDAPI.ScreenRefresh();
    window.close();
}
See Also

Reference