<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Cursors in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292138#M10141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ted,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Right, this is an enhancement at 9.4.&amp;nbsp; Less code, easier to understand.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.3, you would have to use a while loop like so...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = gp.SearchCursor(myTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;row = rows.next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while row:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.4, you can you use a for loop (you can also use the while loop approach if you desire)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in arcpy.SearchCursor(myTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2009 20:50:31 GMT</pubDate>
    <dc:creator>DavidWynne</dc:creator>
    <dc:date>2009-10-29T20:50:31Z</dc:date>
    <item>
      <title>Cursors</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292137#M10140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the support for FOR loops new at 9.4, it seems like I could never get them to work with anything but a while loop.&amp;nbsp; :confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 20:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292137#M10140</guid>
      <dc:creator>TedCronin</dc:creator>
      <dc:date>2009-10-29T20:45:32Z</dc:date>
    </item>
    <item>
      <title>Cursors</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292138#M10141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ted,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Right, this is an enhancement at 9.4.&amp;nbsp; Less code, easier to understand.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.3, you would have to use a while loop like so...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = gp.SearchCursor(myTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;row = rows.next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while row:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 9.4, you can you use a for loop (you can also use the while loop approach if you desire)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in arcpy.SearchCursor(myTable)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 20:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292138#M10141</guid>
      <dc:creator>DavidWynne</dc:creator>
      <dc:date>2009-10-29T20:50:31Z</dc:date>
    </item>
    <item>
      <title>Sweeet</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292139#M10142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Ted,&lt;BR /&gt;Right, this is an enhancement at 9.4.&amp;nbsp; Less code, easier to understand.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;At 9.3, you would have to use a while loop like so...&lt;BR /&gt;&lt;BR /&gt;rows = gp.SearchCursor(myTable)&lt;BR /&gt;row = rows.next()&lt;BR /&gt;while row:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()&lt;BR /&gt;&lt;BR /&gt;At 9.4, you can you use a for loop (you can also use the while loop approach if you desire)...&lt;BR /&gt;&lt;BR /&gt;for row in arcpy.SearchCursor(myTable)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print row.getValue("Rank")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Dave&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Absofrickenlutely, much more pythonic then while loops.&amp;nbsp; This is HUGE.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 21:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cursors/m-p/292139#M10142</guid>
      <dc:creator>TedCronin</dc:creator>
      <dc:date>2009-10-29T21:04:04Z</dc:date>
    </item>
  </channel>
</rss>

