Reputation: 1713
I need to use VB within the framework of SSRS. I am trying to beautify some XPaths in order to make them more presentable to a human user of the report. I haven't gone very far and I hit the first problem.
Module VBModule
Public Function BeautifyXpath(ByVal s As String) As String
Dim strBuilder As New System.Text.StringBuilder(s)
If s.Contains("[") Then
strBuilder.Replace("[%s]", "")
strBuilder.Replace("@", "")
Dim tokens = strBuilder.ToString().Split("/")
For Each token In tokens
Console.WriteLine(token)
Next
Return strBuilder.ToString()
Else : Return s
End If
End Function
Sub Main()
Console.WriteLine(BeautifyXpath("/priorities/priority[%s]/@patternName"))
End Sub
End Module
I get the following error from the compiler:
(8,24) : error VBNC30451: 'token' is not declared. It may be inaccessible due to its protection level.
Upvotes: 0
Views: 2044