文件名称:domino代理求最大(小)值、和、平均数.txt
文件大小:1KB
文件格式:TXT
更新时间:2022-10-01 03:59:50
domin 代
%REM
Agent agtPjs
Created 2019-8-25 by admin/smartdot
Description: Comments for Agent
%END REM
Option Public
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim doc As NotesDocument
Dim numMax As Single
Dim numMin As Single
Dim numHe As Single
Dim numPjz As Single
MsgBox 1111111
Set db = s.Currentdatabase
Set vw = db.Getview("vwDemo")
Set doc = vw.Getfirstdocument
If doc Is Nothing Then
print |视图中没有文档!!!!|
Exit Sub
End If
numMax = 0
numMin = CSng(doc.fldNotes(0))
numHe = 0
numPjz = 0
On Error GoTo errHdl
While(Not doc Is nothing)
MsgBox 3333333
'求和:
numHe = numHe+CSng(doc.fldNotes(0))
'最大值:
If numMax < CSng(doc.fldNotes(0))then
numMax = CSng(doc.fldNotes(0))
End If
'最小值:
If numMin > CSng(doc.fldNotes(0)) Then
numMIn = CSng(doc.fldNotes(0))
End If
Set doc = vw.Getnextdocument(doc)
Wend
'平均值:
numPjz = numHe/vw.Allentries.Count
Print |最大值为:| & CStr(numMax)
Print ""
Print |最小值为:| & CStr(numMin)
Print "
"
Print |和为:| & CStr(numHe)
Print "
"
Print |平均值为:| & CStr(numPjz)
Exit Sub
errHdl:
Exit Sub
End Sub