lotus常用函数

类别:编程语言 点击:0 评论:0 推荐:

在lotus在经常使用的如下公式及函数.

1)@DbColumn("";"":@Subset((@DbName);-1);"viewName";列数)

2)@DbLookup("":"NoCache";"":@Subset((@DbName);-1); "view";"关键列";"域名或列");

3)replace函数
Function StringStuffReplaceString(Byval strArg As String,
Byval strSrc As String,
Byval strDst As String) As String
Dim iPos As Integer
iPos = Instr(strArg, strSrc)
While iPos > 0
strArg = Left$(strArg, iPos - 1) + strDst + Mid$(strArg, iPos +
Len(strSrc))
iPos = Instr(iPos + Len(strDst), strArg, strSrc)
Wend
StringStuffReplaceString = strArg
End Function

4)Session定义
 Dim session As New notessession
 Dim db As notesdatabase
 Dim doc As notesdocument
 Dim cdoc As notesdocument
 Dim view As notesview
Dim dc As NotesDocumentCollection
 Set db = session.currentdatabase
 Set cdoc = session.documentcontext

5)循环删除文档
 While Not(doc Is Nothing)
  Set ndoc=view.getnextdocument(doc)
  Call doc.remove(True)
  Set doc=ndoc
 Wend

6) 在web上删除文档的代理

Sub Initialize
 Dim session As New notessession
 Dim db As notesdatabase
 Dim doc As notesdocument
 Dim item As notesitem
 Dim doctodelete As notesdocument
 Set db = session.currentdatabase
 Set doc = session.documentcontext
 Set item=doc.getfirstitem("Delete")
 Forall unid In item.values
  If unid<>"" Then
   Set doctodelete = db.getdocumentbyunid(unid)
   Call doctodelete.remove(True)
  End If
  
 End Forall
 Exit Sub
End Sub

更多函数可以参见http://www.oaunion.com网站的lotus专区,其中有大部分lotusScript开发下使用的函数.

 

本文地址:http://com.8s8s.com/it/it28961.htm