Select to view content in your preferred language

How to show labels with a certain field value (using VBScript)

2991
3
01-21-2013 06:16 AM
EdwinBaars
Emerging Contributor
Hello,

I'm using ArcPad and I want to show a label by using an expression (VBScript). I don't know VBScript, so I hope to find my answer here.

This is what I'm looking for. I have a layer with different fieldnames. I want to make a label that shows the layer only when the value of the fieldname 'xnumber' is exact 345.

Of course I can easily set a label (with layer properties) that shows the fieldname 'xnumber' but I don't want to see all the other valeus, I only want to see a label when the fieldname 'xnumber' has the value 345.

I suppose that is what 'Labels using the expresssion:' is for?

I hope someone can help me.

Regards,
Edwin
Tags (3)
0 Kudos
3 Replies
EdwinBaars
Emerging Contributor
I read in the reference guide (if I understand it right) that it is not possible to use multiple scripting lines in the exprission field. If that is true I think it's not possible to make a label as asked by myself in this thread (that should be some if else function which can not be written in a single line...).

Regards,
Edwin
0 Kudos
GarethWalters
Deactivated User
Hi Edwin,if labeling won't work for you perhaps a change. in thought might help. what if you created a filter and only showed the specific data you are looking? would a different symbology render do the same job?let me know how you go.cheers,Gareth
0 Kudos
EdwinBaars
Emerging Contributor
Hi Edwin,if labeling won't work for you perhaps a change. in thought might help. what if you created a filter and only showed the specific data you are looking? would a different symbology render do the same job?let me know how you go.cheers,Gareth


Hi Gareth,

We're using just ArcPad, so without any ArcGIS software. As far as I know has ArcPad no utilities to filter or/and to make a different rendering other than use an expression to 'change' the default field value. Or do you know how to write a 'filter expression' other then an 'if then' expression?

At the moment I'm a bit further by using an expression which let the label show only the sixth paramater. Since my I want to 'filter' the value '444444' and most other values has less then six parameters my issue has been sold for about 95%.

I used the expression mid([number],6,10). The number 10 is chosen as a number larger then 6, but can probably 7 as well.

It should be better, for future issues as well, to find out how to write a single line 'if then' expression. Then I can filter only the '444444' values and my issue should be solved for 100%.
0 Kudos