home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac_os2 / ftree10e.zip / BIRTHDAY.FTX < prev    next >
Text File  |  1996-05-02  |  1KB  |  65 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 one shows all Birthdays of every person in the tree.
  6.    The birthdays are ordered by months of this year.>
  7. */
  8.  
  9. /* Params */
  10.  
  11. namewidth=32
  12.  
  13. /* Display Header */
  14. SAY("Birthday List (age at next birthday) "||DATE())
  15. SAY(................................................)
  16.  
  17. datewidth=14
  18. namewidth=datewidth+30
  19.  
  20. /* Sort Mankind by Birth Month and Day */
  21. rc=SORT('BM,BD')
  22.  
  23. /* Calculate actual year */
  24. thisyear=WORD(DATE(),3)
  25.  
  26. /* Display persons in tree */
  27.  
  28. rc=FIRST()
  29. DO UNTIL rc=0
  30.  
  31.    /* Get month of Birth */
  32.    month=getBirthDate('m')
  33.  
  34.    /* Only if date is given */
  35.    IF LENGTH(month)>0 THEN DO
  36.  
  37.       /* Date with static length */
  38.       result=month||' '||getBirthDate('D')
  39.       IF LENGTH(result)<datewidth THEN
  40.          result=result||COPIES(' ',datewidth-LENGTH(result))
  41.       ELSE
  42.          result=LEFT(result,datewidth)
  43.  
  44.       /* Add Names and fit to static length */
  45.       result=result||getName()||','||getFirstName()
  46.  
  47.       IF LENGTH(result)<namewidth THEN
  48.          result=result||COPIES(' ',namewidth-LENGTH(result))
  49.       ELSE
  50.          result=LEFT(result,namewidth)
  51.  
  52.       /* Age this year */
  53.       result=result||' ('||thisyear-getBirthDate('Y')||')'
  54.  
  55.       /* O.K. Output */
  56.       SAY(result)
  57.    END
  58.  
  59.    /* Next one*/
  60.    rc=NEXT()
  61. END
  62.  
  63. /* Done */
  64. RETURN
  65.