Select to view content in your preferred language

Field calculator error 999999

725
1
01-28-2013 01:18 AM
PeterCeelen
New Contributor
Arcmap 10.1

I have a vb script to creat a hyperlink in a new column.
In Arcmap 9.3 this script works perfect.
But in 10.1 i get a error.

Field [FOTO]  holds the values of a photonumber (example 105-2087).
Script Code:

dim naam as string
dim v as variant

naam = [FOTO]

if naam = "" or naam =  " " or  isempty(naam) then
  naam = ""
else
  v = split(naam,"/")
  naam = v(0)
  naam = "Fotos\Foto_2012\p"&replace(naam,"-" ,"")&".jpg"
end if


The result window gives error 999999.


Are there any surgesties the solve the error.
Or is there a new kind of script that i can use to get a photo numer from one column to an other with txt infront and behind
example: column photo input: 105-0285
column photo_hyp output: photo\1050285.jpg

thanks,
0 Kudos
1 Reply
norie
by
Regular Contributor
You can try doing it in python:


In Codeblock:
import re 
def toFileName(fname):
 output = re.sub(r'[^0-9]', '',fname)
 if output:
  return 'photo\\' + output + '.jpg'
 else:
  return ''


PHOTO_HYP=
toFileName(!FOTO!)
0 Kudos