ArcGIS keeps throwing an error when I use the following script in the field calculator, using Python:
pre-logic script code:
y= () if !fieldx!.isalnum(): y= 1 else: y= 0 Fieldy= y
The error in the results window reads:
'ERROR 999999: Error executing function, Syntax Error, Failed to execture (CalculateField)'
I've checked the classes of the fields: fieldx is a string and fieldy a short integer, so that can't be the problem. I've also enabled the shapefile for editing. Note that I've added fieldy using the addfield function.
Other fieldcalculations, for example:
fieldy = 5
do work, so the problem should be in the syntax.
What am I doing wrong?