' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' * ' * Getting server statistics ' * (class dominoStats) ' * ' * sample code from ' * LotusScript to Lotus C API Programmer Guide by Normunds Kalnberzins, (c) 2000-2003 ' * ' * http://www.ls2capi.com ' * ' * Author: Normunds Kalnberzins ' * ' * This code has been written as a sample to illustrate aspects of handling of Lotus C API from LotusScript ' * and may be reused, modified on full responsibility of the developer and provided this notice is preserved ' * ' * The author does not guaranty it to fit any particular purpose and it is up to the developer ' * to modify, test it and determine the limits of its applicability ' * ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' * * * * * * * * START (Class) [DOMINOSTATS] ' * * * * * * * * ' * ' * gets statistics from server ' * Public Class dominoStats Public isServer As Variant Public Stats List As String docStats As NotesDocument ' * * * * * * * * START (Method) [NEW] ' * * * * * * * * ' * Public Sub New Dim s As New NotesSession Set docStats = New NotesDocument(s.currentDatabase) Me.init End Sub ' * * * * * * * * END (Method) [NEW] ' * * * * * * * * ' * * * * * * * * START (Method) [INIT] ' * * * * * * * * ' * ' * fills array with stats and values ' * Public Sub init Dim rethStats As Long, retStatsLength As Long Dim stats As String, tmp Dim labels, vals, i As Integer Dim LF As String LF = Chr(10) W32_StatQuery "", "","=", LF, rethStats, retStatsLength stats = W32_OSLockObjectStr (rethStats) docStats.stats = stats Evaluate {FIELD statsEx:=@explode(stats;@Char(10));""}, docStats Labels = Evaluate ({@left(statsEx;"=")}, docStats) Vals = Evaluate ({@Right(statsEx;"=")}, docStats) If Ubound(Vals)=Ubound(labels) Then For i = 0 To Ubound(Labels) Me.Stats(Labels(i)) = Cstr(Vals(i)) Next Else Print "stats does not match - error..." End If tmp = Evaluate ({@trim(@right(statsEx;"Server."))}, docStats) If tmp(0) = "" Then Me.isServer = False Else Me.isServer = True End If W32_OSUnLockObject rethStats End Sub ' * * * * * * * * END (Method) [INIT] ' * * * * * * * * End Class' * dominoStats ' * * * * * * * * END (Class) [DOMINOSTATS] ' * * * * * * * *