PROBLEM
In some cases, a DOCELL loop may report results different than what is expected.
There is a problem with IF structures inside DOCELL loops. Occasionally, intermediate results are being internally calculated as floating point when they should be integer.
Workaround 1:
If the INT function is performed on the division as follows, the expected results are made:
Grid: docell
:: tmp22 := aa * int(bb / 100)
:: if (0 > 1) out22 = 999
:: else out22 = tmp22
:: end
Grid:
Grid: print out22
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
n n 0 0 0
0 0 0 0 0
Workaround 2:
If the EQUALS operator (=) is used instead, the expected results are made:
Grid: docell
:: tmp33 = aa * (bb / 100)
:: if (0 > 1) out33 = 999
:: else out33 = tmp33
:: end
Grid:
Grid: print out33
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
n n 0 0 0
0 0 0 0 0
Article ID:000005035
Get help from ArcGIS experts
Download the Esri Support App