hood8jmark

vbscript calculator expression wildcard

Discussion created by hood8jmark on Dec 10, 2013
Hi all,

I have beating my head over this for two hours and for the life of me can't figure out the problem.  I am simply trying to populate a field [Tester] with a variable value based on values in another field [UNITBLDG].  I am seeking to glean this value from [UNITBLDG] with a like statement.  Please review the entire code block and expression for any errors in syntax or provide me with another method.  This is being performed in ArcGIS 10.1 on a file geodatabase.  All help will be greatly appreciated.  Thanks.

'Code Block:
dim aValue
if  [UNITBLDG] like '%-' then
aValue = "Unit"
Elseif [UNITBLDG] like '-%' then
aValue = "Bldg."
else
aValue = ""
end if

'expression:
aValue

Outcomes