About This Code
Brief Description:
objectShell
Contributor:
Pierre Koerber
Notes Version:
R4.x, R5.x, R6.x, R7.x
Last Modified:
13 Sep 2005
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Main description
* The file contain the definition of a shell class
* There are two uses for this class :
1. You can use it to sort a normal array, or to sort documents.
2. When sorting document, you should derivate the class to fit you need and override the compare method to fit you needs.
How to test it
* You can cut and paste the code in an agent and put the agent in you mail database.
* Select some documents and then choose the agent in the menu.
* In the status bar, your eMail'subject should appear sorted.
Usage / Example
Function TEST_SHELL - to sort a vector
Function TEST_SHELL2 - to sort a documentcollection
Function TEST_SHELL2 - to sort a documentcollection
' This sample take a DC and sort it
' Have a look on the compare method in the derived class mail_SORTER
Dim db As notesdatabase
Dim se As New notessession
Dim dc As notesdocumentcollection
Dim sortedVect As Variant
Set db = se.currentdatabase
' --- get all the doc
Set dc = db.UnprocessedDocuments
If dc.count = 0 Then
Msgbox "no docs"
Exit Function
End If
' --- Create the object
Dim sh As mail_SORTER
Set sh = New mail_SORTER
' --- Put everything in the object
Call sh.CollectionToArray (dc)
Call sh.sort()
' --- Get the sorted vector
sortedVect = sh.ElementArray()
' --- Print the result
Dim i As Integer
i = Ubound(sortedvect)
Dim k As Integer
For k = 0 To i
Print Str(k) + " " + sortedVect(k).subject(0)
Next
End Function
Code Attachments