Hello,
I have the following VB Script expression to calculate a field in a shapefile.
Since ArcGIS pro doesn’t read VB Script for the field calculation, could someone help me converting it to Arcade or Python ?
I unfortunately don’t have the skills for it.
Thanks.
dim X
if len( [INSEE]) =4 then
X = "0" & [INSEE]
Elseif len( [INSEE])=3 then
X = "00" & [INSEE]
Elseif len( [INSEE])<3 then
X = "?????"
Else X = [INSEE]
end if
dim N
if len( [PREFIXE])=2 then
N = "0" & [PREFIXE]
Elseif len( [PREFIXE])=1 then
N = "00" & [PREFIXE]
Else N = [PREFIXE]
end if
dim Y
If [SECTFEUI] =" " then
Y="????"
Elseif [SECTFEUI] ="0" then
Y="????"
Elseif len( [SECTFEUI]) =3 then
Y = "0" & [SECTFEUI]
Elseif len( [SECTFEUI]) =2 then
Y = "00" & [SECTFEUI]
Elseif len( [SECTFEUI]) =1 then
Y = "000" & [SECTFEUI]
Else Y = [SECTFEUI]
end if
dim Z
if [PARCELLE] ="0" then
Z="????"
Elseif len( [PARCELLE])=3 then
Z = "0" & [PARCELLE]
Elseif len( [PARCELLE])=2 then
Z = "00" & [PARCELLE]
Elseif len( [PARCELLE]) =1 then
Z = "000" & [PARCELLE]
Else Z = [PARCELLE]
end if
__esri_field_calculator_splitter__
KEY=X&N&Y&Z