%Super system variable

Description

%Super returns a reference to an object of the superclass.

A class that extends another class must have a constructor. In addition, the constructor method must include code to initialize its superclass by assigning the %Super system variable to an instance of the superclass. This assignment is allowed only in the constructor for the subclass.

Example

The following example shows this type of assignment:

class Example extends ExampleBase
   method Example();
   ...
end-class;

Global string &CurrentBaseString;

method Example
   %Super = create ExampleBase();
   &BaseString = &CurrentBaseString;
   &SlashString = &BaseString;
   &ImportantDate = Date(19970322);
end-method;