I am using a SearchCursor to return a value from a selected attribute field. But, the cursor does not work or create an error. The ValueGain filed is a Long field type that is has not been set to a string. I am only using the SearchCursor to return a value in the tool dialog window.
Code:
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", whereClause)
df.extent = lyr.getSelectedExtent()
df.scale = df.scale*1.1
arcpy.AddMessage(str(whereClause))
cursor = arcpy.da.SearchCursor("Land", ["ValueGain"])
for row in cursor:
arcpy.AddMessage(str(ValueGain))
del row
del cursor