Select to view content in your preferred language

UpdateCursor.Reset() method not working.

1330
5
02-28-2011 07:27 AM
NeilOllerhead
Emerging Contributor
I am trying to use the .Reset() method to re-iterate through a list of records in a featureclass but it isn't working.  The first loop executes perfectly but when it gets to the second loop it doesn't start...the 'row' object is 'None'. 

I have done a bunch of searches trying to see if I am calling the reset method incorrectly but it appears as everything is fine.  Any help or suggestions would be appreciated.


-----------------
rows = gp.UpdateCursor(lyrInput,'','','','FIRST_ A')
row = rows.next()

while row:
    ### do something

rows.reset()
row = rows.next()
while row:
    ### do something else
Tags (2)
0 Kudos
5 Replies
KimOllivier
Honored Contributor
The training course notes suggest that all the Reset methods are to be implemented "in the future".
Meanwhile you have to close the cursor and reopen it to get the equivalent.
0 Kudos
OlivierOlivier
Regular Contributor
I do confirm, reset doesn't work !
0 Kudos
RDHarles
Regular Contributor
It's been in the documentation as far back as 2005 and has never worked! :mad:
0 Kudos
xuzhe
by
New Contributor
I do confirm, reset still doesn't work !
0 Kudos
MathewCoyle
Honored Contributor
I agree the documentation could be more clear. It does state, or rather omits, that reset() is not a supported method here, under "The Cursor Object".

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001q000000
0 Kudos