home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 8046 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.7 KB  |  50 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!usc!cs.utexas.edu!convex!constellation!osuunx.ucc.okstate.edu!vms.ocom.okstate.edu!adams
  3. From: adams@vms.ocom.okstate.edu
  4. Subject: Re: INHERITED: what are the advantages
  5. Message-ID: <1993Jan11.124620.1@vms.ocom.okstate.edu>
  6. Lines: 37
  7. Sender: news@osuunx.ucc.okstate.edu (USENET News System)
  8. Nntp-Posting-Host: vms.ocom.okstate.edu
  9. Organization: OSU College of Osteopathic Medicine
  10. References: <29505@oasys.dt.navy.mil>
  11. Date: Mon, 11 Jan 1993 18:46:20 GMT
  12.  
  13. In article <29505@oasys.dt.navy.mil>, roth@oasys.dt.navy.mil (Pete Roth) writes:
  14. > There's not much in the BP7 docs about using the reserved word
  15. > INHERITED, although it is used in place of all previously fully
  16. > qualified method invocations. For example, in place of
  17. > CONSTRUCTOR TDerived.Init ;
  18. >     BEGIN
  19. >         TBase.Init
  20. >         ...
  21. > the new "example" is
  22. > CONSTRUCTOR TDerived.Init ;
  23. >     BEGIN
  24. >         INHERITED Init
  25. >         ...
  26. > How is this new model an advantage?
  27.  
  28. In the development of an object, it is possible to change the base class
  29. (parent class, whatever you learned to call it) to something else.  I myself
  30. have done this (creating a TIcon object, whose original base class was TButton,
  31. now it is TView -- using TP6.0 TVision).  The use of INHERITED makes the code
  32. more readable as well.
  33.  
  34. BTW, I wish this feature was available in TP6.0.  Now I'll have to go out and
  35. buy BP7.0 (-:
  36.  
  37. > - - - - - - - - - - - - - - - - - - - - - - - - - -
  38. > Grace & peace
  39. > Pete                         roth@oasys.dt.navy.mil
  40. > "Easy for me, difficult for you." - Senor Wences.
  41.  
  42. Steven Adams (INTERNET: adams@vms.ocom.okstate.edu)
  43. Oklahoma State University
  44. College Of Osteopathic Medicine
  45. Tulsa, OK  74107
  46.