AnsweredAssumed Answered

UpdateCursor Variable Syntax

Question asked by alantoms on Jun 4, 2012
Latest reply on Jun 4, 2012 by alantoms
Hello All,

I am working on a script with an updatecursor and running into a syntax problem???I think.  My variables are hardcoded at this time, till I get it working.  The feature class and field to update are variables.  I think line row.inputField = 6 is where I believe I have the problem; line row.LinkID = 5 does work as LinkID is a field name.  It is looking for a field by the name of inputField instead of a variable.  I'm sure it is something simple.  Anyone have a suggestion?

Thank you for the help.

import arcgisscripting  # Create the Geoprocessor object gp = arcgisscripting.create(9.3)  # Input Variables inputFC = r"C:\GIS_Work\Temp.gdb\Subs" inputField = "LinkID"  cur = gp.UpdateCursor(inputFC) row = cur.Next() while row:     #row.LinkID = 5     row.inputField = 6         cur.UpdateRow(row)     row = cur.Next()     print "Value Added"          print "UpdateCursor Works"