Dim agentLog As New NotesLog("Agent log") Call agentLog.OpenAgentLog
Set s = New NotesSession
Set db = s.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set note = collection.GetFirstDocument
count = collection.Count
Do While (count > 0)
Subject = note.Subject Call agentLog.LogAction( "Processing: "+Subject(0))
Set note = collection.GetNextDocument (note)
count = count - 1
Loop Call agentLog.Close
On Error DivisionByZero Goto LogError
Dim errorLog As New NotesLog( "Errors" )
Dim x As Integer, y As Integer, z As Integer
Call errorLog.OpenFileLog( "c:\errlog.txt" )
y = 13
z = 0
rem The following line will generate an error for this example
x = y / z
Call errorLog.Close
Exit Sub
LogError:
Call errorLog.LogError( ErrDivisionByZero, Error$( ErrDivisionByZero ) )
Resume Next
Tell amgr status
Tell amgr statusコマンドは、Agent Managerの状況のスナップショットを表示します。Agent Managerのキューや制御パラメーターの状況を調べることができます。このコマンドを使うと、現在どのパラメーターが有効なのかを確認できます。以下に、出力例を示します。
12/26/02 10:30:15 AM AMgr: Status report at '12/26/02 10:30:15 AM'
12/26/02 10:30:15 AM Agent Manager has been running since '12/22/02 02:18:25 PM'
12/26/02 10:30:15 AM There are currently '1' Agent Executives running
12/26/02 10:30:15 AM There are currently '4' agents in the Scheduled Task Queue
12/26/02 10:30:15 AM There are currently '0' agents in the Eligible Queue
12/26/02 10:30:15 AM There are currently '0' databases containing agents triggered by new mail
12/26/02 10:30:15 AM There are currently '0' agents in the New Mail Event Queue
12/26/02 10:30:15 AM There are currently '3' databases containing agents triggered by document updates
12/26/02 10:30:15 AM There are currently '3' agents in the Document Update Event Queue
12/26/02 10:30:15 AM AMgr: Current control parameters in effect:
12/26/02 10:30:15 AM AMgr: Daily agent cache refresh is performed at '12:00:00 AM'
12/26/02 10:30:15 AM AMgr: Currently in Daytime period
12/26/02 10:30:15 AM AMgr: The maximum number of concurrently executing agents is '1'
12/26/02 10:30:15 AM AMgr: The maximum number of minutes a LotusScript/Java agent is allowed to run is '10'
12/26/02 10:30:15 AM AMgr: The maximum percentage of time agents are allowed to execute is '90'
12/26/02 10:30:15 AM AMgr: Executive '1', total agent runs: 414
12/26/02 10:30:15 AM AMgr: Executive '1', total elapsed run time: 273
Function MayIUseFEClass() As Boolean
' error defined in lserr.lss
' Public Const ErrAdtCreateError = 217
On Error 217 Goto NoYouMayNot
Dim uiws As NotesUIWorkspace ' declare front-end class
Set uiws = New notesuiworkspace
MayIUseFEClass = True
Exit Function
NOYOUMAYNOT:
MayIUSEFEClass = False
Exit Function
End Function
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem
Dim ToWho(40) As String
Dim FirstName(40) As String
Dim Msg As String
Set db = session.CurrentDatabase
Set doc = New notesdocument(db)
**********************************************************