Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
What version of TC are you running, just in case there's a bug that has been fixed in later versions?
In any case, I tried the following with a table variable with 2 columns and 31 rows.
And it worked fine the first time. This seems to tell me that the problem is not in the use of the table to run a loop or the table itself but may be more related to the code you are executing within the loop. I don't personally see how code could cause the problem you're experiencing but, at this point, I've ruled out, at least generally speaking, table-driven loops being the cause of the problem.
Another possibility... what exactly is in the data in your table? Do you have special characters, etc, that you may be passing in that might confuse the "Click" or "Compare Property" command?
In any case, I tried the following with a table variable with 2 columns and 31 rows.
function TestTableLoop()
{
Project.Variables.MyTable.Iterator.Reset()
while (!Project.Variables.MyTable.Iterator.IsEOF())
{
Log.Message(Project.Variables.MyTable.Iterator("Column1"))
Log.Message(Project.Variables.MyTable.Iterator("Column2"))
Project.Variables.MyTable.Iterator.Next()
}
}
And it worked fine the first time. This seems to tell me that the problem is not in the use of the table to run a loop or the table itself but may be more related to the code you are executing within the loop. I don't personally see how code could cause the problem you're experiencing but, at this point, I've ruled out, at least generally speaking, table-driven loops being the cause of the problem.
Another possibility... what exactly is in the data in your table? Do you have special characters, etc, that you may be passing in that might confuse the "Click" or "Compare Property" command?