1.dim temp as Variant----------- variant指的是任意变量
2.关于数组的定义:
A:dim array(1 to 7) as string------定义了一个一维数组;
B:dim array(1 to 7,1 to 4) as string ----定义了一个二维数组;
C:dim num as Integer-----------------定义一个维数不定数组;
num=40
dim personall() as string
redim personall(1 to num,1 to 4) as string
3.传参数获得参数:
window.open("(Agttongjimzpy)?openagent&dept="+deptname);
Dim dept As String
Dim querystring As String
querystring=curdoc.QUERY_STRING_DECODED(0)
dept = GetParameter("dept",querystring)
//GetParameter函数
Function GetParameter(paramName As String, queryString As String) As String
Dim startpos,endpos,skiplen As Integer
queryString = queryString + "&" +paramName+"="+"&"
paramName= Ucase("&"+paramName+"=")
skiplen = Len(paramName)
startpos = Instr(Ucase(queryString),paramName)+skiplen
endpos=Instr(startpos,queryString,"&")
GetParameter=Mid(queryString,startpos,endpos-startpos)
End Function
4.得到视图和条目
Dim sentry As NotesViewEntryCollection
Set view =db.getview("VWxxbryldrymzpy")
Set sentry=view.GetAllEntriesByKey(dept,True)
5.打出alert,并关闭窗口
If sentry.Count=0 Then
Print "<SCRIPT LANGUAGE='JavaScript'>"
Print "alert( '没有找到相关文档!');"
Print "window.close();"
Print "</SCRIPT>"
Exit Sub
End If
6.得到条目和将该条目转成文档
Dim tempitem As NotesItem
Set firentry=sentry.GetFirstEntry
Set tempdoc=firentry.Document
//得到下一个条目
Set firentry=sentry.GetNextEntry(firentry)
7.在文档中得到域的值:
tempdoc.FDyuming(0)
//若域名用变量得到
tempPL="FD8_"+Cstr(i)
Dim tempvalues As Variant
tempvalues = tempdoc.GetItemValue(tempPL)
tempvalues(0)
8.将数字格式化成百分制的
Format(0.988888,"fixed")-----将其改成 0.98
Format(0.988888,"percent")---将其改成 98.89%(四舍五入了)
Format(0.988888,"0.0%")-------将其改成 98.9%(四舍五入了)
9.将代理中的错误行和错误类型打出了
On Error Goto e
………………
e:
msgbox "-------"+cstr(Error)+"-------"+cstr(Erl)