@Word function in LotusScript

There is an @Word function in Lotus Notes which is useful for extracting a value from a string with known separator.

If MyString is a string as follows:
'Value1~Value2~Value3~Value4~Value5~' then Word( Mystring;"~";3) will return Value3

You can write a similar function in LotusScript to obtain the same result.

 Code: ReturnValue = ExtractValue(mystring, "~", 3) Function ExtractValue(PassString As String, Sep As String, Pos As Integer) As String Dim StartPos As Integer Dim GetPos As Integer StartPos = 0 GetPos = 0 For i = 1 To Pos StartPos = GetPos GetPos = Instr(StartPos + 1, PassString, "~") Next ExtractValue = Trim(Mid$(PassString,StartPos+1,GetPos-StartPos-1)) End Function

Dig Deeper on Domino Resources - Part 2



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury