0
votes

I'm trying to create an object in lotus notes and work in an OOP manor. Lotus script only kind of wants me to be able to do that.

One of the things I'm having a hard time finding is if classes in lotus script have any notion of themselves. In C# you can use the "this" keyword and python has the concept of self. Does lotus script have a similar concept?

1

1 Answers

6
votes

LotusScript has the keyword Meto refer to the current class instance.

From IBM's example code for the class construct, you can see Me references on the last two lines of the InvertColors() method.

' 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