LotusScript是否具有相同的这个或自我?

Sid*_*ney 0 oop lotus-notes lotusscript object

我正在尝试用莲花笔记创建一个对象并在OOP庄园中工作.Lotus脚本只是希望我能够做到这一点.

我很难找到的一件事是莲花剧本中的课程是否有自己的概念.在C#中,您可以使用"this"关键字,而python具有self的概念.莲花脚本有类似的概念吗?

Ric*_*rtz 6

LotusScript具有Me引用当前类实例的关键字.

从IBM的类构造的示例代码中,您可以在InvertColors()方法的最后两行看到Me引用.

' Define a class.
Class textObject
   ' Declare member variables.
   backGroundColor As Integer
   textColor As Integer
   contentString As String
   ' Define constructor sub.
   Sub New (bColor As Integer, tColor As Integer, _
      cString As String)
      backGroundColor% = bColor%
      textColor% = tColor%
      contentString$ = cString$
   End Sub
   ' Define destructor sub.
   Sub Delete
      Print "Deleting text object."
   End Sub
   ' Define a sub to invert background and text colors.
   Sub InvertColors
      Dim x As Integer, y As Integer
      x% = backGroundColor%
      y% = textColor%
      Me.backGroundColor% = y%
      Me.textColor% = x%
   End Sub
End Class
Run Code Online (Sandbox Code Playgroud)