Lydia cssaua at
Tue Apr 7 17:00:08 CEST 2009

I am working on calculating one of the fields in a feature class based on other 2 fields. The logic is, 
A (the resulting field) is calculated from B, but C and D have part of the value that could fill the blank of B, which meaning that combine three fields of values can make A.

Field A is what I need.

The data looks like: .

A   B   C   D
 2  2
 5  5
 4        4
 6               6

 cur = gp.UpdateCursor(data)
    row = cur.Next()
    gp.CalculateField_management(data, "A", "[B]", "VB", "")
 while row:


        if  not(row.GetValue("C") == 'NULL'):
        elif not(row.GetValue("D") == 'NULL'):
        row = cur.Next()
    del cur
    del row

But the out looks like only B was calculated to A successfully. C&D are not in A. 

I guess there must be something wrong with the code, but I am very new to Python, and not familiar with the expression. Could anybody help ?  PS. I am coding Python with ARCGIS.

Thanks a lot.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list