      $set mfoo

      ************************************************************************
      * Copyright (C) 1996-1999 Micro Focus International Ltd.
      * All rights reserved.
      *  
      * This demonstration program is provided for use by users of 
      * Micro Focus products (the "Software") and may be used, 
      * modified and distributed as part of your application provided 
      * that you properly acknowledge the copyright of Micro Focus in this
      * material.
      *     
      * All conditions, warranties and undertakings, express or implied, 
      * statutory or otherwise, on the part of Micro Focus are excluded, 
      * including without limitation those of merchantability or fitness  
      * for purpose. This shall not, however, purport to exclude or 
      * restrict the liability of Micro Focus to any extent not 
      * permitted by law.
      *
      * IN NO EVENT WILL MICRO FOCUS BE LIABLE FOR ANY INDIRECT, 
      * INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT 
      * OF THE USE OF THE DEMONSTRATION PROGRAM DISTRIBUTED WITH THE 
      * SOFTWARE, WHETHER OR NOT INFORMED OF THE POSSIBILITIES OF 
      * DAMAGES IN ADVANCE.  THESE LIMITATIONS APPLY TO ALL CAUSES OF 
      * ACTION, INCLUDING BREACH OF CONTRACT, BREACH OF WARRANTY, STRICT
      * LIABILITY, AND ANY ACTIONS IN TORTS.
      ************************************************************************
      * Program to demonstrate inheritance by creating instances of
      * different sorts of Account class
      ************************************************************************

       program-id. bank3.

        object section.
        class-control.
           Account is class "account"
           SavingsAccount is class "saccount"
           HighRateAccount is class "haccount"
           CheckAccount is class "caccount"
           AccountExceptionHandler is class "acexhand"
           .
       working-storage section.

      *----The first object is for CheckAccounts;
      *    the second for SavingsAccounts;
      *    the third for HighRateAccounts.
           01  anaccount  object reference.
           01  acustomer  pic x(80) value spaces.
           01  anamount   pic 9(10)v99.

       procedure division.
      *----B000. Register exception handler
           invoke AccountExceptionHandler "initializeHandlers"
      *----B010. Deliberately provoke an exception by attempting to
      *    open a HighRateAccount with an insufficient opening balance.
           move "Mike" to aCustomer
           move 999 to anAmount
      *----B020. Create the account
           invoke HighRateAccount "openAccount" using aCustomer
                                                      anAmount
                                            returning anAccount
           stop run.

