LotusScript Example of Evaluate to Remove One Name in a List/Group

Author: Tripp W Black

Created: 08/15/2000 at 11:18 PM

 

Category:
Notes Developer Tips
LotusScript

You da man! That worked perfectly. For public reference, there is no need to create a tmpRemoveName field on the group document. Simply assign doc.tmpRemoveName to the name you want to remove and then place tmpRemoveName inside your EVALUATE. Many thanks!

CL


Original message:

You are correct that in version <R4.6, notes required statements for evaluate to be pseudo (or real) constants because the formula had to be resolved at compile time. But it's simple to deal with by adding a couple of statements to your code:

doc.tmpRemoveName = RemoveName
doc.List = Evaluate ( {@trim(@Replace(List; tmpRemoveName; ""))}, doc)
doc.removeitem "tmpRemoveName"



ANOTHER EXAMPLE

This loops over a collection of docs and loops through the members field of those docs. If it finds username, it removes it, stops searching that doc, saves and continues on the next doc.

For i =1 To coll.count
Set cdoc = coll.getnthdocument(i)
memArr = cdoc.members
For j=0 To Ubound(memArr)
If memArr(j) = username Then
memArr(j) = ""
memArr = Fulltrim(memArr)
cdoc.members = memArr
Call cdoc.save(True, False)
Exit For
End If
Next
Next




previous page