Thursday, October 23, 2008

NotesDocumentCollection.IsSorted where I can use it?

I looked on this method many times and still don't understand where/how I can use it.
I really expected that new method NotesDocumentCollection.Sort(...) would in Lotus Notes later, but it did not happen. So how can I cook it? Can anybody explain me? What I see that we really can't sort collection at all...

Sub Click(Source As Button)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.FTSearch( "white wine", 0 )
If collection.IsSorted Then
Messagebox( "This collection is sorted" )
Else
Messagebox( "This collection is unsorted" )
End If
End Sub

2 comments :

Anonymous said...

It depends on how you create the collection.

If you create the collection via FTSearch, the result is sorted (you have a sort option in FTSearch).

Otherwise the collection is unsorted.

Anonymous said...

And you can sort a collection, if you, for example, use a list and put all the documents from that collection into the list. Probably with a list key you would like them to be sorted into.

And i have seen sorting algorythms for collections too. But not integrated into the lotus script model, which is truly a flaw.