home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TFDD.ZIP / TFDD.DOC < prev    next >
Encoding:
Text File  |  1990-07-13  |  3.3 KB  |  65 lines

  1. This is the documentation file for an archive also holding Turbo Pascal 5.5
  2. source for four object-oriented units that illustrate and apply TFDD's --
  3. text file device drivers:
  4.         tfdd.pas, a generic TFDD class meant only for inheritance. but suitable
  5.                 for any TFDD;
  6.         kbdEdit.pas, a tfdd descendant that implements a decent line editor for
  7.                 Read's and Readln's (like the editor the TP IDE uses for option
  8.                 windows)
  9.         strWrite.pas, a second tfdd descendant that simply allows writes to go
  10.                 to a string instead of to any output; the string can then be
  11.                 retrieved later
  12.         writAttr.pas, a third tfdd descendant that allows display attributes to
  13.                 be specified right in the middle of a write.
  14.  
  15. The point of using text file device drivers to do this is that a TFDD is simply
  16. invoked as a file variable whithin any Read, Readln, Write or Writeln, so:
  17.         1) you can still use the special flexibility of these Pascal commands,
  18.                 which can't be reproduced in normal in procedures;
  19.         2) pre-existing code is extremely easy to convert;
  20.         3) for quick work, no new procedures have to be learned -- you simply
  21.                 add the proper unit to the Uses clause, and call the proper file
  22.                 var.
  23.  
  24. Notes:
  25.    Tfdd.pas makes use of the User Data field in a text record to pass the
  26. address of Self to the various driver functions. TFDD's are older than OO
  27. facilities in TP, so they do not directly allow for object implementation. But,
  28. simply by using User Data as it's intended to be used, they can integrate quite
  29. well with objects. Both KbdEdit and StrWrite use the Self pointer, and in
  30. KbdEdit the tfdd's work is actually done by a class method.
  31.    Each of the three descendant units automatically initializes one instance of
  32. the class it defines, as part of its unit initialization code. In the case
  33. KbdEdit and WritAttr, it's hard to imagine why you'd need more than one
  34. instance of the class. But for StrWrite you might. All you'd have to do is
  35. declare
  36.         VAR otherStr: strWriteC;
  37. then call
  38.         otherStr.init;
  39.    KbdEdit and WritAttr use TP's Crt unit. Take care to replace the mention, in
  40. the implementation Uses lists, with OpCrt or TpCrt if you use those.
  41.  
  42.  
  43. Copyright notice:
  44.    I claim copyright on this file and the four source files mentioned.
  45.    These units are not put into the public domain, so as to prevent the
  46. diffusion of half-modified versions. The source code may be distributed by any
  47. means in complete form and as is, including the present notice, or not at all.
  48. Modifications, etc. may be ADDED to the distributed code, as separate texts, of
  49. course.
  50.    As author and copyright owner I waive all legal rights on object or
  51. executable code compiled using part or all of these units. This is to avoid any
  52. administrative complication for users.
  53.    However, I request that any programmer using this source code for paid work
  54. or for sold programs send me a $5 contribution at:
  55.                 Philippe Ranger
  56.                 P. O. Box 48017
  57.                 5678 Park Avenue
  58.                 Montreal  QC  H2V 4S8
  59.                 Canada
  60.  
  61. Comments would be much appreciated. My CompuServe user ID is 71531,1350.
  62.  
  63.         Philippe Ranger
  64.         July 13, 1990
  65.