function a NotesDatabase object, it wil return the size of the index in bytes.
For example, if you wanted to display the size of the FTS index for the current
database, in a format consistent with the value in File - Database -
Properties, you can use this button code:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim fts&, adj&
fts&=GetFTSize(s.CurrentDatabase)
If fts& > 0 Then
' convert number to format displayed in File - Database - Properties
adj&=Fix(fts& / 1024)
If adj& > 999 Then
Msgbox "Full text size: " & Fix(adj& / 1000) & " MB", 0, "FTS Size
Sample"
Else
Msgbox "Full text size: " & adj& & " KB", 0, "FTS Size Sample"
End If
Else
Msgbox "This database has no FTS index", 48, "FTS Size Sample"
End If
End Sub
' (Declarations)
Declare Sub OSPathNetConstruct Lib "nnotes" (Byval portName As String, Byval
ServerName As String, Byval FileName As String, Byval retPathName As String)
Declare Function NSFDbFTSizeGet Lib "nnotes" (Byval Filename As String, FTSize
As Long) As Integer
Function GetFTSize(db As NotesDatabase) As Long
Dim path$
Dim fts&
path$=Space$(256)
' create an API-friendly path
OSPathNetConstruct "", db.Server, db.FilePath, path$
Call NSFDbFTSizeGet(path$, fts&)
' returns 0 if no index; otherwise, size of .ft directory (in bytes)
GetFTSize=fts&
End Function
This was first published in November 2000