# function to return appropriate 3.0 feature class for given 2.6 feature class # and it returns the name of the fieldname, FC_26_name def which30(two6ftrcls): two6FC = two6ftrcls whereclause = "Two6FCs = '" + two6FC + "'" gp.AddMessage("whereclause is " +whereclause) crosswalk = ShellPath + "/Two630FC_IDPKxwalk.dbf" # The variables row and rows are initially set to None, so that they # can be deleted in the finally block regardless of where (or if) # script fails. row, rows = None, None Three0ftrlst = [] FC_26namelst = [] rows = gp.SearchCursor(crosswalk,whereclause) row = rows.next() if (row == None): gp.AddMessage("check the Two630FC_IDPKxwalk.dbf table for Two6FCs -->" +two6FC) elif (row != None): rows = gp.SearchCursor(crosswalk,whereclause) for row in rows: if not row.isNull("Three0FCs"): Three0ftr=row.getValue("Three0FCs") Three0ftrlst.append(str(Three0ftr)) FC_26name = row.getValue("FC_26") FC_26namelst.append(str(FC_26name)) if row: del row if rows: del rows return Three0ftrlst, FC_26namelst
Solved! Go to Solution.
for theRow in theCursor: pass
theRow = theCursor.next() while theRow: pass theRow = theCursor.next()
for theRow in theCursor: pass
theRow = theCursor.next() while theRow: pass theRow = theCursor.next()