home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP09.EXE / CHP0901.PRG < prev    next >
Encoding:
Text File  |  1991-06-01  |  750 b   |  34 lines

  1. /*
  2.    Listing 9.1. Processing a "family" array.
  3.    Author: Craig Yellick
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. #define SURNAME  1
  12. #define PARENT   2
  13. #define CHILD    3
  14. #define SPOUSE1  2,1
  15. #define SPOUSE2  2,2
  16.  
  17. function ListFamily(f_)
  18.   local i
  19.   if len(f_[PARENT]) = 1
  20.     ? f_[SPOUSE1] +" " +f_[SURNAME]
  21.   else
  22.     ? f_[SURNAME] +": "
  23.     ?? f_[SPOUSE1] +" and " +f_[SPOUSE2]
  24.   endif
  25.   if len(f_) > 2
  26.     ? "Children:"
  27.     for i := 1 to len(f_[CHILD])
  28.       ?? " " +f_[CHILD, i]
  29.     next i
  30.   endif
  31. return nil
  32.  
  33. // end of file CHP0901.PRG
  34.