Manage Learn to apply best practices and optimize your operations.

LS version of @Keywords

This tip describes Lotuscript versions of @Keywords.

This is a LotusScript version of a List comparing function @Keywords. It is enhanced to return another result other than with @Keywords. The documentation within the code is self-explanatory.

Function LSKeywords( ssLSKCList1 
As Variant, ssLSKCList2 As Variant,
 vLSKCompFlag As Variant ) As Variant
Args : ssLSKList1 - List1 to check
ssLSKList2 - List2 to check
vLSKCompFlag - Flag to tell the mode 
of checking, check Desc for more details.

Desc : Extended function of @Keywords : 
if vLSKCompFlag is true - returns only 
those items from 
the second list that are found in the first
 list else returns only those items from 
the first list that are not found in the 
second list
Function Call e.g.
 LSKeywords( "3":"4":"5":"8":"4" , "5":
"6":"4":"7" , True ) returns "4":"5"
 LSKeywords( "3":"4":"5":"8":"4" , "5":
"6":"4":"7" , False ) returns "3":"8"

Called at : widely used
Calls : None
 Dim ssLSKCRtnList( ), 
ssLSKRtnList( ), vLSKC  As Variant
 Dim iLSKC, iLSK As Integer
 iLSKC = 0
 Redim Preserve ssLSKCRtnList
( iLSKC ) As Variant
 iLSK = 0
 Redim Preserve ssLSKRtnList
( iLSK ) As Variant
 Forall x In ssLSKCList1
  vLSKC = True
  Forall y In ssLSKCList2
   If x = y Then
    vLSKC = False
    Redim Preserve ssLSKRtnList
( iLSK ) As Variant
    ssLSKRtnList( iLSK ) = y
    iLSK = iLSK + 1
   End If
  End Forall
  If vLSKC Then
   Redim Preserve ssLSKCRtnList
( iLSKC ) As Variant
   ssLSKCRtnList( iLSKC ) = x
   iLSKC = iLSKC + 1
  End If
 End Forall
 If vLSKCompFlag Then
  LSKeywords = ssLSKRtnList
  LSKeywords = ssLSKCRtnList
 End If
End Function

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials'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 ...