      *
      * Uses multiple inheritance
      * inline method invokes
      * property syntax
      * parameterized classes (see Manager class)
      * object views
      *
      $set repository(checking on)
       identification division.
       program-id. personnel.
       repository.
           class Employee   as "Employee"
           class CharString as "String"
           class Student    as "Student"
           class IndPlacement as "IndPlacement"
           class Person     as "Person"
           property jobTitle
           property courseTitle
           .

       01 person1    usage object reference Person.
       01 emp1       usage object reference Employee.
       01 emp2       usage object reference Employee.
       01 emp3       usage object reference Employee.
       01 indPlace1  usage object reference IndPlacement.

       01 personIndex usage binary-short value 0.
       01 personTable occurs 3 times usage object reference Person.

       procedure division.

      * Create some employee objects using object
      * properties and inline method invocation
      *
           invoke Employee "newemployee" using "George Brown"
                                               "12/02/1957"
                                         returning emp1

      * P005 Set jobtitle using inline method invocation and object
      * property

           set jobtitle of emp1 
               to CharString::"newstring"("Senior Analyst Programmer") 

           invoke Employee "newemployee" using "Bernard Smith"
                                               "01/01/1974"
                                 returning emp2
           set jobtitle of emp2
               to CharString::"newstring"("Analyst Programmer")

      * P010. Multiple inheritance - Indplacement inherits from
      * student and employee.
           invoke IndPlacement "newindplacement" using "John White"
                                                       "23/07/81"
                                              returning indPlace1
      * using employee property

           set jobTitle of indPlace1
               to CharString::"newstring"("Junior Programmer")

      * using student property
           set courseTitle of indPlace1
               to CharString::"newstring"("Physics")

      * object views

      * create a person object for the example below
           invoke Person "newperson" using "Mike Jones" "14/10/1991"
                                     returning person1
           set personTable(3) to person1
      *
      * We can always set a typed object reference to one which is of
      * the sub class
      *
      *   employee inherits person
           set personTable(1) to emp1
      *
      *   IndStudent inherits employee inherits person
           set personTable(2) to IndPlace1

      *  However we can't set an employee object reference to a person
      *  object reference because its type may not actually contain
      *  an employee object

      *  set emp3 to personTable(1) *> syntax error

      *  because we believe it does we can tell the compiler to allow
      *  this to be deferred to run time - get rts error if not
      *  correct type
      *
          set  emp3 to personTable(1) as employee

      * P015. You can avoid the RTS error by using the following
      * Micro Focus extension
      *
           if personTable(1) instance of employee
               set  emp3 to personTable(1) as employee
               display "ok"
           else
               display "not ok"
           end-if

      *  P020. Polymorphism at work. The specific display method of the
      *  class of each object reference will be called

           move 0 to personIndex
           perform 3 times
               add 1 to personIndex
               invoke personTable(personIndex) "display"
           end-perform

           stop run
           .

