I was thinking of that, but in my particular situation it seems quite an inefficient way.
I have a list of error messages. They are concatenated and prepared to be shown in the BBCodeview:
Sub ConcatenateListItems(lst As List, strSeparator As String, bAddIndex As Boolean, bClickableNumbers As Boolean) As String
Dim i As Int
Dim strResult As String
Dim strURLStart As String
Dim strURLEnd As String
If bClickableNumbers Then
strURLStart = "[url]"
strURLEnd = "[/url]"
End If
If bAddIndex Then
For i = 0 To lst.Size - 1
If i = 0 Then
If bClickableNumbers Then
'we need the [Plain] tag as otherwise will get an error with for example showing an error log with: create table ddd([ID] integer >> invalid tag [ID]
strResult = strURLStart & (i + 1) & ") " & strURLEnd & "[Plain]" & lst.Get(i) & "[/Plain]"
Else
strResult = strURLStart & (i + 1) & ") " & strURLEnd & lst.Get(i)
End If
Else
If bClickableNumbers Then
strResult = strResult & strSeparator & strURLStart & (i + 1) & ") " & strURLEnd & "[Plain]" & lst.Get(i) & "[/Plain]"
Else
strResult = strResult & strSeparator & strURLStart & (i + 1) & ") " & strURLEnd & lst.Get(i)
End If
End If
Next
Else
For i = 0 To lst.Size - 1
If i = 0 Then
strResult = lst.Get(i)
Else
strResult = strResult & strSeparator & lst.Get(i)
End If
Next
End If
Return strResult
End Sub
Then with a click on the URL there will be a dialog with options to deal with the particular error message.
One is to clear that message, so delete it from the list and re-save the list to KVS.
After having cleared the message I show the new list again in the same BBCodeview as there can be messages
near the cleared message that need clearing again. So I want when showing the new list I want the BBCodeview
to be scrolled to the position of the previously cleared message. As I have the value of this scroll position I want
to just use this to scroll to that same position again (in code, not manually).
So, I don't think I need anchors.
RBS