Using the @Sort function, you can sort a list of values in descending or ascending order.
How It Works
The @Sort function is a built-in Formula Language function. This function requires two parametersa list of values and the sort order expression(s). There are numerous sort order expressions, including
Ascending[ASCENDING]
Descending[DESCENDING]
Accent-Sensitive[ACCENTSENSITIVE]
Accent-Insensitive[ACCENTINSENSITIVE]
Case-Sensitive[CASESENSITIVE]
Case-Insensitive[CASEINSENSITIVE]
Custom Sort[CUSTOMSORT]
Pitch-Sensitive[PITCHSENSITIVE]
Pitch-Insensitive[PITCHSENSITIVE]
One or more expressions can be specified in the function call. Each expression must be enclosed in brackets and separated by semicolons.
Implementation
To sort the list, simply include the list of values and sort order expression(s). The following illustrates how to sort a list of values in ascending order (see Figure 14.20). Simply replace the list of values or assign a field to the myValues variable. The @Prompt statement is used for illustrative purposes and can be removed or updated as desired.
myValues := "Mark" : "Ryan" : "Kyle" : "Alex"; result := @Sort ( myValues; [Ascending] ); @Prompt([Ok]; "Sample Sort"; "Original List: " + @Implode(myValues; ", ") + @NewLine + "Sorted List: " + @Implode(result; ", "))
Figure 14.20. Example of the @Sort function
An Introduction to the Lotus Domino Tool Suite
Getting Started with Designer
Navigating the Domino Designer Workspace
Domino Design Elements
An Introduction to Formula Language
An Introduction to LotusScript
Fundamentals of a Notes Application
Calendar Applications
Collaborative Applications
Reference Library Applications
Workflow Applications
Web Applications
Design Enhancements Using LotusScript
Design Enhancements Using Formula Language
View Enhancements
Sample Agents
Miscellaneous Enhancements and Tips for Domino Databases
Data Management
Security
Application Deployment and Maintenance
Troubleshooting
Appendix A. Online Project Files and Sample Applications
Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?