AnsweredAssumed Answered

Formula differences

Question asked by jamesfreddyc on Sep 27, 2012
Latest reply on Sep 27, 2012 by jamesfreddyc
ArcGIS 9.3.1

I am attempting to calculate a field with a specific formula, which actually works correctly when I plug it into the FieldCalculator in ArcGIS 9.3.1 --- however, I am getting a different result when I place the formula into a Python script.

edit: "fff" is just a field that holds an incremental value starting at 1. 

This works in the Field Calculator:
40 - (Int(( [fff] - 1) / 35) + 1) + 1

My attempt to calc the field in the script is like:

rowsr = gp.UpdateCursor(outLabelsFC) rowr = rowsr.Next() i = 1 while row:       rowr.setvalue("row", (40 - ((rowr.fff - 1) / 35) + 1) + 1)       rowsr.updateRow(rowr)       i = i + 1       rowr = rowsr.Next() 


Python doesn't like the "Int", so I have tried:
40 - ((rowr.fff - 1) / 35) + 1) + 1
and...
40 - (long((rowr.fff - 1) / 35)) + 1) + 1

Both of the above generate a different result from run in the field calculator.  Can you help explain why or what I am missing here?

Thanks!

Outcomes