I ran a test on that and it works like a charm!I tried to take it a step further though and I found that I can't use the getattr ( , ) function to allow the user to define what the input field name will be.
InAge = gp.GetParameterAsText(0)
OutField = gp.GetParameterAsText(1)
rows = gp.UpdateCursor("c:\temp\test.dbf")
row = rows.Next()
while row:
if getattr(row, InAge) == 25:
getattr(row, OutField) = "Mid" #<-- DOES NOT WORK: RETURNS SYNTAX ERROR AT THIS LINE
#row.Range = "Mid"
"ERROR: Failed to check - syntax error - can't assign to function call (test.py, line 23)"I guess the reason it fails is this: In the if line " if getattr(row, InAge) == 25:" we are assigning a user value to the variable then asking IF it equals 25, do the following: Then in the following, we assigning another user value to the variable to be the FieldName, but then immediately trying to re-assign a new value, changing the FieldName, to the input value for that field. Then python gets confused and screwy. Unless there is some kind of list or tuple or something that would allow the storage of more than one value in the attribute to be used in this circumstance, I don't know if it would ever work...Thanks jscheirer,- James