home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / tools.zip / TOOLS.COM / DAYOFWK.FUN < prev    next >
Text File  |  1988-10-20  |  3KB  |  54 lines

  1. DAYOFWK    FUNCTION(OPTION,DATEIN)
  2. !---------------------------------------------------------------------!
  3. !  THIS FUNCTION WILL RETURN A STRING CONTAINING THE DAY OF THE       !
  4. !  WEEK (MONDAY, TUESDAY, ETC.).                                      !
  5. !                                                                     !
  6. !  TO CALL THIS FUNCTION.                                             !
  7. !                                                                     !
  8. !     STRING = DAYOFWK(OPTION,DATEIN)                                 !
  9. !                                                                     !
  10. !  WHERE:                                                             !
  11. !                                                                     !
  12. !        OPTION = A BYTE FIELD AS FOLLOWS.                            !
  13. !                                                                     !
  14. !                 0 - SHORT FORM OF DAY (MON, TUES, ETC.).            !
  15. !                 1 - LONG FORM OF DAY (MONDAY, TUESDAY, ETC.).       !
  16. !                                                                     !
  17. !        DATEIN = A LONG FIELD CONTAINING THE DATE IN THE FORM        !
  18. !                 RETURNED BY THE CLARION TODAY() FUNCTION.           !
  19. !---------------------------------------------------------------------!
  20. !     COMPILER: CLARION V2.0                                          !
  21. !       SYSTEM: N/A                                                   !
  22. !     FUNCTION: DAYOFWK                                               !
  23. !  ENVIRONMENT: CALLED HAS A FUNCTION                                 !
  24. !   REFERENCES: NONE                                                  !
  25. !---------------------------------------------------------------------!
  26. !  HISTORY:                                                           !
  27. !    WRITTEN   10/20/88 BY DOMINICK G. GALLUCCI                       !
  28. !    MODIFIED  00/00/00                                               !
  29. !---------------------------------------------------------------------!
  30.  
  31. DATEIN     LONG                     !DATE
  32. DATEOUT    STRING(10)               !DISPLAY DATE
  33. OPTION     BYTE                     !OPTION CODE
  34.                                     !0 SHORT
  35.                                     !1 LONG
  36.  
  37. DAY_A_TBL    STRING('SUN  MON  TUES WED  THURSFRI  SAT  ') !DAY ABBREVIATIONS
  38. DAY_SHORT    STRING(5),DIM(7),OVER(DAY_A_TBL)    !DAY OF WEEK
  39.  
  40. DAY_L_TBL    GROUP
  41.              STRING('SUNDAY   MONDAY   TUESDAY  WEDNESDAYTHURSDAY ')
  42.              STRING('FRIDAY   SATURDAY ')
  43.              .
  44. DAY_LONG     STRING(9),DIM(7),OVER(DAY_L_TBL) !DAY OF WEEK
  45.  
  46.   CODE
  47.  
  48.     IF OPTION = 0 THEN
  49.       DATEOUT = DAY_SHORT[DATEIN % 7 + 1]
  50.     ELSE
  51.       DATEOUT = DAY_LONG[DATEIN % 7 + 1]
  52.     .
  53.     RETURN(DATEOUT)
  54.