home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
tools.zip
/
TOOLS.COM
/
DAYOFWK.FUN
< prev
next >
Wrap
Text File
|
1988-10-20
|
3KB
|
54 lines
DAYOFWK FUNCTION(OPTION,DATEIN)
!---------------------------------------------------------------------!
! THIS FUNCTION WILL RETURN A STRING CONTAINING THE DAY OF THE !
! WEEK (MONDAY, TUESDAY, ETC.). !
! !
! TO CALL THIS FUNCTION. !
! !
! STRING = DAYOFWK(OPTION,DATEIN) !
! !
! WHERE: !
! !
! OPTION = A BYTE FIELD AS FOLLOWS. !
! !
! 0 - SHORT FORM OF DAY (MON, TUES, ETC.). !
! 1 - LONG FORM OF DAY (MONDAY, TUESDAY, ETC.). !
! !
! DATEIN = A LONG FIELD CONTAINING THE DATE IN THE FORM !
! RETURNED BY THE CLARION TODAY() FUNCTION. !
!---------------------------------------------------------------------!
! COMPILER: CLARION V2.0 !
! SYSTEM: N/A !
! FUNCTION: DAYOFWK !
! ENVIRONMENT: CALLED HAS A FUNCTION !
! REFERENCES: NONE !
!---------------------------------------------------------------------!
! HISTORY: !
! WRITTEN 10/20/88 BY DOMINICK G. GALLUCCI !
! MODIFIED 00/00/00 !
!---------------------------------------------------------------------!
DATEIN LONG !DATE
DATEOUT STRING(10) !DISPLAY DATE
OPTION BYTE !OPTION CODE
!0 SHORT
!1 LONG
DAY_A_TBL STRING('SUN MON TUES WED THURSFRI SAT ') !DAY ABBREVIATIONS
DAY_SHORT STRING(5),DIM(7),OVER(DAY_A_TBL) !DAY OF WEEK
DAY_L_TBL GROUP
STRING('SUNDAY MONDAY TUESDAY WEDNESDAYTHURSDAY ')
STRING('FRIDAY SATURDAY ')
.
DAY_LONG STRING(9),DIM(7),OVER(DAY_L_TBL) !DAY OF WEEK
CODE
IF OPTION = 0 THEN
DATEOUT = DAY_SHORT[DATEIN % 7 + 1]
ELSE
DATEOUT = DAY_LONG[DATEIN % 7 + 1]
.
RETURN(DATEOUT)