home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol12n05.zip / DAYSUF.SC next >
Text File  |  1992-09-14  |  619b  |  20 lines

  1. ; ------------------------------------------------------------
  2. ; DAYSUF.SC                                          Paradox
  3. ; Accepts a date and returns the appropriate day suffix
  4. ; for the day number.  For example, returns st for 21,
  5. ; th for 15, rd for 3 and so on.
  6. ; ------------------------------------------------------------
  7. PROC Daysuf(t)
  8.   SWITCH
  9.     CASE DAY(t) = 1 OR DAY(t) = 21 OR DAY(t) = 31
  10.          : c = "st"
  11.     CASE DAY(t) = 2 OR DAY(t) = 22
  12.          : c = "nd"
  13.     CASE DAY(t) = 3 OR DAY(t) = 23
  14.          : c = "rd"
  15.     OTHERWISE
  16.          : c = "th"
  17.   ENDSWITCH
  18.   RETURN c
  19. ENDPROC
  20.