Original User: azzwan
I am not sure if this is the best forum to post this question but hopefully someone can point me in the right direction.
I have a thinned bathymetry points file where the depths are negative in sign and drying heights are positive. I intend to create a map and label my points as depths as you would see them on a nautical chart. For example the the negative depths become positive values and the depths are rounded to 1 decimal place etc. I have a a small VB Script for doing just that and it works quite well. However, I have a problem, the drying heights appear as negative numbers once labelled. I would like to have the drying heights remain positive sign but become underlined labels. I do not know much about scripting so if anyone can help me out with a way to do this it would be greatly appreciated.
To enter the label script I go to layer properties>label>test string Expression>Under Expression I tick the advanced option and then paste in the VBScript. I then click on Verify to make sure that it works and then OK.
Here is an example of the points file [ATTACH=CONFIG]31500[/ATTACH]
Here is an example of how the points are labelled[ATTACH=CONFIG]31501[/ATTACH]
Here is the current VB Script that I am using:
Function FindLabel ( [Depth] )
fltDepth = Round([Depth] * -1, 1)
strChar = "."
intPos = InStr(1, fltDepth, strChar)
intLen1 = Len(fltDepth)
intLen2 = intLen1 - intPos
If intPos <> 0 Then
intStart = Left(fltDepth, intPos - 1)
intLast = Right(fltDepth, intLen2)
'strOutput = intStart & " " & intLast
FindLabel = intStart & "<SUB>" & intLast & "</SUB>"
Else
FindLabel = fltDepth
End If
'FindLabel = strOutput
End Function
Regards, Aaron