home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / v / vol12n06.zip / BOMEOM.SC next >
Text File  |  1992-08-14  |  603b  |  27 lines

  1. ;Bom(dDay) - Returns the first of the month
  2. PROC Bom(dDay)
  3.   IF dDay = BLANKDATE() THEN
  4.     dDay = TODAY()
  5.   ENDIF
  6.   RETURN dDay - DAY(dDay) +1
  7. ENDPROC
  8.  
  9. ;Eom(dDay) - Returns the last of the month
  10. PROC Eom(dDay)
  11.   PRIVATE dBump
  12.   IF dDay = BLANKDATE() THEN
  13.     dDay = TODAY()
  14.   ENDIF
  15.   dBump = dDay + 35 - Day(dDay)
  16.   RETURN dBump - Day(dBump)
  17. ENDPROC
  18.  
  19. ;The following script demonstrates the above procedures
  20. CLEAR
  21. MESSAGE "The first of this month is " + STRVAL(Bom(TODAY()))
  22. SLEEP 2000
  23. CLEAR
  24. SLEEP 500
  25. MESSAGE "The last of this month is " + STRVAL(Eom(BLANKDATE()))
  26. SLEEP 2000
  27.