我继承了一个项目的噩梦,那时候我只能假设LOC是lotus脚本中可以接受的KPI。在我被要求改变公司应用程序的工作方式后,我正在重构重复代码。下面的代码说明了我对Lotus脚本语法的一些不理解之处——我在domino设计器中遇到了一个错误,它位于“Control=UIDoc.Document…..”需要“集合”的行。查看现有代码,有时Set用于赋值,有时不用于赋值。我正在尝试阅读lotus脚本文档,但尚未找到差异的解释。有人能告诉我什么时候应该使用电视机,什么时候不应该使用电视机吗?如果有帮助的话,我有很强的C语言背景,在JS和PHP等解释性语言方面有一些小的经验
Class DeploymentType
Private ProductName As String
Private ControlSuffix As String
Private TypeHeader As String
Private Control As NotesRichTextItem
Sub new (Product As String, Suffix As String, Header As String, UIDoc As NotesUIDocument)
'These three assignments do not show an error without set
ProductName = Product
ControlSuffix = Suffix
TypeHeader = Header
'This assignment shows an error unless I prepend it with "Set"
Set Control = UIDoc.Document.GetFirstItem(ProductName + ControlSuffix)
End Sub