cancel
Showing results for 
Search instead for 
Did you mean: 

Iterator IsEOF returning true ... I am certain I am doing something dumb

SOLVED
Super Contributor

Iterator IsEOF returning true ... I am certain I am doing something dumb

I have this code which is trying to loop through the rows of a table variable. 

var checkStaff = KeywordTests.InstructorInquirySmoke.Variables.Staff; var iterator = checkStaff.Iterator; var staffCode; iterator.Reset(); while(!iterator.IsEOF) { staffCode = iterator.Value(0); if (Staff.IsStaffExists()) { Log.Checkpoint("Instructor " + staffCode + " exists.", "", pmNormal, attr, Aliases.browser.pageMain.Picture()); } else { Log.Error("Instructor " + staffCode + " DOES NOT exist.", "", pmNormal, attr, Aliases.browser.pageMain.Picture()); } iterator.Next(); }

Iterator is not entering while loop. I am looking at checkStaff in debug watch. It (rightly) has 2 rows. iterator is showing as an object but with no details.

Can someone spy what I am doing wrong? I confess being the friday before a holiday I strongly suspect operator error.

 

2 REPLIES
Community Hero

Re: Iterator IsEOF returning true ... I am certain I am doing something dumb

Hi,

 

According to the documentation and the code samples, .IsEOF() is a method, not a property.

Have you tried

while(!iterator.IsEOF())

instead of your

while(!iterator.IsEOF)

? Does it help?

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Super Contributor

Re: Iterator IsEOF returning true ... I am certain I am doing something dumb

Sigh. Thanks.

2018 NEWS
Top Kudoed Authors