I have Python calculate field expression (.cal file) that does this but I'm trying to migrate it to Arcade.
It's not working. The number part is not incrementing and I guess it has to do with me not being able of defining 'rec' as a global variable.
This is the Python expression. How do I migrate the 'global rec' line to Arcade?
#Params
val_counter = 2498
prefix = 'PP_'
interval = 1
# -------------------------------------------
# Function
rec=0
def SetIDcode(val_counter, prefix, interval):
global rec
if (rec == 0):
rec = val_counter
else:
rec += interval
return (prefix+ str(rec))