home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac_os2 / ftree10e.zip / LNGEVITY.FTX < prev    next >
Text File  |  1996-05-02  |  1KB  |  49 lines

  1. /*
  2.    Family Tree Rexx Script FTX
  3.    Copyright (C) 1996 by <Nils Meier>
  4.    Please send comments to meier2@athene.informatik.uni-bonn.de
  5.    <This script shows the longevity of all persons in the tree
  6.    that have a date of birth and death.>
  7. */
  8.  
  9. /* Params */
  10. namewidth=40
  11.  
  12. /* Display Header */
  13. SAY("Longevity Analysis.  Today's date :"||DATE())
  14. SAY(.............................................)
  15.  
  16. namewidth=40
  17.  
  18. /* Sort Mankind by Name,FirstName */
  19. rc=SORT('L')
  20.  
  21. /* Display persons in tree */
  22.  
  23. rc=FIRST()
  24. DO UNTIL rc=0
  25.  
  26.    /* Check if we have Birth & Death (J=JulianDate) */
  27.    birth=getBirthDate('J')
  28.    IF LENGTH(birth)>0 THEN DO
  29.       death=getDeathDate('J')
  30.       IF LENGTH(death)>0 THEN DO
  31.  
  32.          /* Say the result*/
  33.          result = getName()||','||GetFirstName()
  34.          IF LENGTH(result)<namewidth THEN
  35.             result=result||COPIES(' ',namewidth-LENGTH(result))
  36.          ELSE
  37.             result=LEFT(result,namewidth)
  38.  
  39.          SAY(result||' ('||(death-birth)%365||')')
  40.          END
  41.       END
  42.  
  43.    /* Go for next */
  44.    rc=NEXT()
  45. END
  46.  
  47. /* Done */
  48. RETURN
  49.