Hello,I am attempting to iterate through the results of a query and save the previous result to use in an operation with the next result.I am saving the feature returned from the current cursor in a (previous feature) variable for the next iteration. I am trying to make a series of lines from a shapefile of points.My code is below. Note in the while loop, the swap, which does not appear to work.Any suggestions would be appreciated. Thanks in advance!
# get an original selection
gp.MakeFeatureLayer_management(shpPath, 'myQuery')
gp.SelectLayerByAttribute('myQuery', 'NEW_SELECTION', '', '', '', 'pointID A')
myCursor = gp.SearchCursor('myQuery')
curFeature= vertexCursor.Next()
while (curVertexFeature):
prevFeature = curFeature
curFeature = myCursor .Next()
print str(prevFeature.getValue('pointID')) + ',' + str(curFeature.getValue('pointID'))