[GIS] Troubleshooting ERROR 000989 Python syntax error from ArcGIS Field Calculator

arcgis-10.0arcgis-desktoperror-000989field-calculatorpython-parser

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why.
I'm trying to create a function to just set the values of all cells in a column to be a multiple of the argument that I pass in ( I wanted to try something simple to test it out, as anything more complicated I tried also failed).
enter image description here

However, the error messages are telling me that my syntax is incorrect:

enter image description here

but I can't understand what is incorrect.


As an aside, I'm also horrified at how hard it is to write readable python in the field calculator box as there is no syntax highlighting, or clear indentation. It would be quicker, and easier to write an external Python script to do this calculation, but I want to try to figure out how this new function worked within the program.

Best Answer

It might be because you're using a field name where a parameter name should go.

Instead, try something like:

def avg(paramName):
    return 10
Related Question