Domino 9 und frühere Versionen > Entwicklung

Docs aus Collection entfernen

(1/1)

Rob Green:
ich steh auf dem Schlauch..

will eigentlich was ganz simples..

in einer normalen

While Not Doc is Nothing
..Bedingung
Call Collection.DeleteDocument(Doc)
..
Set doc = Collection.GetNextDocument(Doc)
Wend

Natürlich sagt mir Notes dann nach dem ersten Löschen eines Docs aus der Notesdocumentcollection, daß das Doc nicht da ist, wenn er an die Stelle "Set doc = dc.GetNextDocument(Doc)" kommt.

Hm..wie ist der Ausweg?
Irgendwie bekomme ich den Trick mit 2 doc- (docA und docB) Zuweisungen auch nicht hin. Wie also mehrere Docs aus einec Coll löschen?

Performance:
ich denke das geht in etwa so

While Not Doc is Nothing
..Bedingung

set doc2 = doc
..
Set doc = Collection.GetNextDocument(Doc)
Call Collection.DeleteDocument(Doc2)
Wend



cu

Rob Green:
so vielleicht?


--- Code: ---While Not Doc is Nothing

  docB = doc

    If..Bedingung...Then
    Flag$="Löschen"
    End if

  Set doc = Collection.GetNextDocument(Doc)

    if Flag$= "Löschen" Then
    Call Collection.DeleteDocument(DocB)
    End If

Wend
--- Ende Code ---

also das verschieben der Zeile Call... nachdem das nächste Doc in der Coll geholt wird?

@edit: @Performance, lese gerade Dein Posting während ich meine eigene Antwort abgefeuert hatte...ein Mann ein Gedanke...ich denke, so passt es. Thx  :D

Jérôme:
Dim docA As NotesDocument Dim docB As NotesDocument Dim col As NotesDocumentCollection Set docA = col.GetFirstDocument While Not (docA Is Nothing)   Set docB = col.GetNextDocument (docA)   Call col.DeleteDocument (docA)   Set docA = docB Wend

Könnte das gehen?

Gruß
- Jérôme

Rob Green:
passt  :)

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln