in a db in a LotusScript agent, built a list of Unids to archive and delete. Then the following interesting thing happens:
Dim ct&, db as NotesDatabase, dbArchive as NotesDatabase, doc as NotesDocument, listArch List as Integer
’ listarch has been filled by statements like:
If Not doc Is Nothing Then
If doc.Size > 0 And doc.IsValid And Not doc.IsDeleted Then listArch(doc.UniversalID) = 1
End If
ct = 0
Forall vArch In listArch
ct = ct + 1
Set doc = db.GetDocumentByUNID(Listtag(VArch))
Call doc.CopyToDatabase(dbArchive)
Call doc.Remove(True)
End ForAll
when ct > 32768, this generates an error 4000 on every doc.
When this happens, and i have the debugger open, I can see that the property doc.IsDeleted is False.
Only when I have clicked OK in the dialog: ‘IBM Domino Designer’:‘Notes error: Document has been deleted’, then the property .IsDeleted is True. But that happens inside the doc.Remove(True) call, so i cannot test for it.
I now have added a On Error Resume Next just before the Remove call and an On Error GoTo errHandler just after. I also log the rrors, which in this particular case logs approximately 7000 lines of an error 4000: Document has been dleted in line x, since the amount of docuemnts collected for deletion is just under 40.000.
This reeks of an internal 16 bit counter overflowing…