cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

2 REPLIES 2
Highlighted
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 Hero]
____
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Super Contributor

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

Sigh. Thanks.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors