1

I used the address range VB script

Function FindLabel ( [TOADDL], [TOADDR] )
  FindLabel = [TOADDL]  & "/" & [TOADDR] 
End Function

Tried

Function FindLabel ( [TOADDL], [TOADDR] )
if (([TOADDL] > 0) AND ([TOADDR] > 0)) then:
  FindLabel = [TOADDL]  & "/" & [TOADDR] 
End Function

But Still did not work

To display the address ranges but my map comes up with 0s all over the map. What else can I add to the coding that would suppress and not display the 0s on my map. See attached left side.

enter image description here

1

How about something like this

Function FindLabel ( [TOADDL], [TOADDR] ) 
  if (([TOADDL] > 0) AND ([TOADDR] > 0)):
  FindLabel = [TOADDL] & "/" & [TOADDR] 
End Function

I may not have the code exactly right but a condition should work to limit the expression of the label.

Edit: I double-checked today and it is working for me (I only changed the field names because yours are not the same as mine). I get labels everywhere where I have an address range (essentially everywhere where those fields are populated) so I can't imagine what could be different in your environment.

Of course you must paste this in using the "Advanced" dialog (click "verify" to be sure it is working) and your field names must match. Mine are string fields. Also I'm using the "VBSCRIPT" parser.

You say there are "zeros all over the map". Is it possible that the values in those particular centerlines are zeros?

enter image description here

  • Didn't work. Any other ideas? Cleaned up your coding and tried Function FindLabel ( [TOADDL], [TOADDR] ) if (([TOADDL] > 0) AND ([TOADDR] > 0)) then: FindLabel = [TOADDL] & "/" & [TOADDR] End Function – slivingston49 Jul 30 '14 at 20:16
  • Any other ideas? – slivingston49 Jul 31 '14 at 13:50
  • Function FindLabel ( [TOADDL, [TOADDR]] ) if (([TOADDL] > 0) AND ([TOADDR] > 0)) then: FindLabel = [TOADDL] & "/" & [TOADDR] End Function This code I tested and it worked for me. Let me know if it works for you. – jbchurchill Aug 1 '14 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.