home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / trl14db.zip / TRLPRG.EXE / EOW.PRG < prev    next >
Text File  |  1990-10-22  |  771b  |  26 lines

  1. ***********
  2. * EOW.PRG
  3. * by Tom Rettig and Leonard Zerman
  4. * Placed in the Public Domain by Tom Rettig Associates, 10/22/1990.
  5. *
  6. * SYNTAX: DO EOW WITH <expD> 
  7. * RETURN: <expD> Sunday of the week in which the parameter date falls
  8. * NOTE  : To make this function return Friday instead of Sunday,
  9. *         replace the conditions specified below.
  10. *********
  11. PARAMETERS tr_date
  12.  
  13. DO CASE
  14.    CASE DOW(tr_date) = 1         && replace 1 with 5 to return Friday
  15.       tr_retd = tr_date
  16.    CASE DOW(tr_date) = 2         && replace 2 with 7 to return Friday
  17.       tr_retd = tr_date + 6
  18.    OTHERWISE                     && replace 8 with 2 to return Friday
  19.       tr_retd = tr_date + ( 8 - DOW(tr_date) )
  20. ENDCASE
  21. IF fox
  22.    RETURN (tr_retd)
  23. ENDIF
  24. * eofunc eow *
  25.  
  26.