This is a web application and I need to have the MainLPField field fill with some values… I tried to use the ReplaceSubstring function but did not remove the spaces from the itemLP
How can I have the spaces removed from the append Call itemLP.appendtotextlist( “answer” &Cstr(j))
code…
Dim itemLP As NotesItem
Forall x In LPOption
Set itemLP = New NotesItem(doc, "MainLPField", "" )
If Not itemLP.Contains( "answer" & Cstr(j)) Then
Call itemLP.appendtotextlist( "answer" &Cstr(j))
End If
End Forall
the answer in my field MainLPField as the value answer1, answer2, answer3 instead of the value answer1,answer2,answer3
it ends up with a space between each values. the MainLPField is not a multi value field.
I need this value so I can use it with javascript
Function…
Private Function ReplaceSubstring(Byval sSource$, Byval sFrom$, Byval sTo$) As String
Dim sResult As String
Dim iLocationOfFrom As Integer
Dim iOffset As Integer
sResult = sSource$
iOffset = Len( sFrom$ )
iLocationOfFrom = Instr( sResult, sFrom$ )
Do While iLocationOfFrom >= 1
sResult = Left$( sResult, iLocationOfFrom-1 ) & _
sTo$ & Mid$( sResult, iLocationOfFrom + iOffset )
iLocationOfFrom = Instr( sResult, sFrom$ )
Loop
ReplaceSubstring = sResult
Exit Function
End Function
thanks
Alena