@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



  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...