@IsNotMember in Script

Any suggestions for the best way to replicate the functionality of @IsNotMember in Lotus Script?

Subject: Try this for a start…

From Mental Notes Inc…

Function IsMember(tstr As String, va As Variant) As Integer

 Dim ret_val As Integer

 ret_val = False

 'Loop through each value in the array

 Forall s In va

      'Compare the string with each member of the array

      If tstr = s Then

           ret_val = True

           'If the string is a member then break out of the loop

           Exit Forall

      End If

 End Forall

 

 IsMember = ret_val

End Function

Subject: RE: Try this for a start…

How very R4… Not to denegrate anything Chuck has said, there is an underused LS array function called ArrayGetIndex that returns NULL if the search element does not appear in the array, and the index number if it does. So @IsNotMember is:

IsNull(ArrayGetIndex(sourceArray, searchValue [,compMethod]))

Subject: Cool, thanks Stan!

One day I will go through all the R6 documentation, probably just in time for R7 rollout!

Subject: RE: Try this for a start…

I actually ended up using InStr…forgot about that when I posted. Thanks for your help, though!