【发布时间】:2016-01-14 15:37:37
【问题描述】:
我对如何使用这个 LotusScript sn-p 继续执行程序有点迷茫。它从视图中提取所有文档,但是,它遇到了包含“溢出”错误的某个文档,该错误会停止程序,而不是忽略这一点并继续下一个文档。错误信息正在被打印出来,所以很明显代码正在进入ErrorHandler,然后随后结束。
Option Public
Option Declare
Sub Initialize
'init stuff, etc
Set view = db.getView("Main")
Set doc = view.getFirstDocument()
Set lastDoc = view.getLastDocument()
k = 0
While (Not doc is Nothing)
dealId = doc.DealId(0)
If(doc.HasEmbedded) Then
Set body = doc.GetFirstItem("Body")
If(Not body Is Nothing) Then
'code to extract all attachments on a document
End If
End If
nextDoc:
Set doc = view.getNextDocument(doc)
k = k + 1
Wend
Exit Sub
errHandler:
Print "Get error when process document with dealId=" & dealId & " at line " & CStr(Erl) & ". Err=" & CStr(Err) & ", error=" & Error
GoTo nextDoc
'this should continue execution of nextDoc
End Sub
【问题讨论】:
-
虽然这个问题已经得到解答,但它并没有解决你为什么会首先出现溢出的根本原因。是在代码中被删除了,还是因为它是一个整数并且超过了 32k 而导致 K 溢出?或者是否有一些其他的算术计算意味着您的变量类型需要审查?
-
@FruitySoup 不知道。我只是从数据库中提取附件 - 而不是算术运算。特别是我经常遇到一个,所以可能是文件太大了?
标签: lotus-notes lotusscript lotus