|
|
|
|
|
|
|
|
|
|
|
|
|
|
The new NotesOutline class in Notes 5.0 (continued)
If you've worked with LotusScript and Notes you will notice how similar working with an outline is to working with a view or collection. Basically, you access the first element in the object and continue until the last item has been processed.
In addition to accessing elements in an outline, entries can be added, removed, and moved via LotusScript. The AddEntry method is used to add a new entry, RemoveEnty removes an entry, and MoveEntry allows the location of an entry within an outline to be changed.
A more complex scripting example Let's take a look at a somewhat more complext routine that makes use of some more outline features.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim outline As NotesOutline
Dim entry As NotesOutlineEntry, tempEntry As NotesOutlineEntry
Set db = session.CurrentDatabase
Set outline = New NotesOutline(db)
Set entry = outline.GetFirst
While Not (entry Is Nothing)
If (entry.TitleText = "Something") Then
Set tempEntry = entry
Set entry = outline.GetNext(entry)
Call outline.RemoveEntry(tempEntry)
Else
Set entry = outline.GetNext(entry)
End If
Wend
End Sub
|
It's a slightly more complex routine. Read on to learn how it all works.
- First, we declare NotesOutlineEntry classes.
- Next, we check the text of the entry.
- If a match is found, the entry will be removed. We have to set a temporary variable to the outline entry to be deleted, because we need to keep track of our place in the outline.
- Then, set the pointer to the next entry from the outline.
- Remove the entry from the outline; we use the temporary variable as the entry to remove.
- If a match is not found, we go to the next entry in the outline.
There are numerous properties of the NotesOutlineEntry class that can be used to determine certain characteristics of them. For instance, the IsInThisDB property signals true or false whether the outline entry is in the database (e.g., link to a view, document) or not (e.g., link to an Internet Web site). This can be used in an if/then block to signal its location, like this:
If (entry.IsInThisDB) Then
Print "This entry: " & entry.TitleText & " is in this database."
Else
Print "This entry: " & entry.TitleText & " is not in this database."
End If
|
Conclusion Notes Release 5.0 has a number of major improvements for building full-feature applications. This includes Internet support in the Notes client, which makes it much simpler to build applications for the Notes client as well as Web browsers. Next month we will cover more LotusScript enhancements in Notes Release 5.0.
Dan Velasco is a Senior Technical Editor for WebSpherePower Magazine and DominoPower Magazine. He's a Sun Certified Java Programmer, Sun Certified Web Component Developer and an IBM Certified Solution Developer for WebSphere Studio V5.0. He's also a Principal CLP Application Developer (R4, R5 and ND6) as well as a CLP System Administrator (R4 and R5). You can reach him via email at dvelasco@webspherepower.com or on the Web at http://DanVelasco.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|