Forum Discussion

simonaferrara's avatar
simonaferrara
Frequent Contributor
4 years ago

Table variables - retrieve row number using the Iterator

Hi all,   I'm working with Table variables: https://support.smartbear.com/testcomplete/docs/testing-with/variables/data-types/table.html   and executing a loop to get the variable values using th...
  • AlexKaras's avatar
    4 years ago

    Hi,

     

    to retrieve the actual row number that the iterator is processing

    Iterator object does not provide such property, so you'll need to implement it yourself:

    iterator.Reset();

    let iRowNo = 0;

    while (!iterator.IsEOF())
    {
            firstColumnValue = iterator.Value(<firstColumn>);
            secondColumnValue = iterator.Value(<secondColumn>);
           

            //here I would like to retrieve the actual row number that the iterator is processing

            Log.Message(iRowNo);


            iterator.Next();

            iRowNo++;
    }