This is the loop I always use on document collections/views. You have to check for deleted/valid documents, and often also for conflicts. You can use some nested IF...THEN...ELSE - but this will make the code har to read. Instead I use a simpel goto construction - and with this you can easily add more checks to the code...
Do Until doc Is Nothing
If doc.IsDeleted Then Goto NEXTDOC
If Not doc.IsValid Then Goto NEXTDOC
If doc.HasItem( "$Conflict" ) Then Goto NEXTDOC
NEXTDOC:
set doc = coll.getNextDocument( doc )
loop
Sunday, November 2, 2008
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment