I want to create and program an arc map add in commend in vb.net. to calculates a measure of gender structure ((Male_pop/FEAMLE_POP)*100 in a GenderStr field. I am getting an error I have included both my code and error message I am getting. I am wondering if anyone can help me what is the problem to solve this error?
thanks
Is [FEMALE_POP] ever zero? If so you would get a runtime error dividing by zero.
No .[FEMALE_POP] is not zero !
Just thought I'd ask. I have shared your query to a more appropriate forum, maybe an ArcObjects programmer can help you out...
Can you copy & paste the expression from your code into ArcMap? Does it works?
I do not think you need the square brackets any more.
Mody, that's a good suggestion.
Square brackets [FIELD] are still used for VBScript expressions, for all data types.
Exclamation points: !FIELD! are used for Python expressions.
Note, you may want to explicitly set the parser (this defaults to VBScript, which will fail if the tool is run in 64 bit).
http://desktop.arcgis.com/en/arcmap/10.4/tools/data-management-toolbox/calculate-field.htm
In arcGIS it works, maybe I am using wrong expression in my programming ? can you help me to write correct expression ?
I hope GenderStr is double and not string. ArcMap will translate automatically but not the code