TopLevelEntryCount (NotesView - LotusScript®)

Read-only. The number of top-level entries in a view.

Note: This property is new with Release 5.

Defined in

NotesView

Data type

Integer

Syntax

To get: count% = notesView .TopLevelEntryCount

Usage

If the view is categorized, this count is the number of main categories.

If the view has totals, this count includes the grand total.

Where the count may exceed 32767, read this property into a Long and if it is negative add 65536. However, unless you are sure the number of top-level entries will always remain 65535 or less, use of this property is not advised. It does not throw an error if the number of entries exceeds 65535, so there is no way to tell if the result was correct.

This code example shows a general technique that is more efficient even for views well under the size limit:

Function TopEntryCount(vu As NotesView) As Long
	' return the number of top-level entries in a view.
	Dim nav As NotesViewNavigator, ent As NotesViewEntry
	Set nav = vu.CreateViewNav
	Set ent = nav.GetLast
	TopEntryCount = Clng(Strtoken(ent.GetPosition("."), ".", 1))
	If ent.IsTotal Then
		' if the view has a totals row, we might not want to count it.
		TopEntryCount = TopEntryCount - 1
	End If
End Function

Example