Re: DAYOFWEEK function


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Grant Foraker on July 02, 2014 at 13:44:30:

In Reply to: Re: DAYOFWEEK function posted by Yves Ste-Marie on July 02, 2014 at 11:27:53:

Here some OLD code that still works. With the (ZDYCT + 3) in the code it has to break someday.

================================================

LENGTH 1 & LOCAL DT$
LENGTH 2 & LOCAL DOM$, MONTH$
LENGTH 4 & LOCAL YEAR$
LENGTH 7 & LOCAL Z2$
LENGTH 8 & LOCAL MMDDYY$, YYMMDD$
LENGTH 8 & LOCAL AGE$
LENGTH 10 & LOCAL Z1$
LENGTH 1.0 & LOCAL LEAPYR, ZDYWK
LENGTH 2.0 & LOCAL DAY, MONTH, ERR, UX, UY
LENGTH 4.0 & LOCAL YEAR
LENGTH 5.0 & LOCAL TEMPNUM, ZDYYR
LENGTH 6.0 & LOCAL ZDYCT

!------------------------------------------------------------------------
LET MMDDYY$ = MONTH$ + DOM$ + YEAR$
LET ZDYCT = DATETONUM(MMDDYY$,ERR) ! EDIT DATE
IF ERR EQ 1 GOTO INVALIDDATE ! INVALID
LET ZDYWK = (ZDYCT + 3) MOD 7 ! DAY OF WEEK
IF ZDYWK EQ 0 LET ZDYWK = 7 ! SUNDAY
!========================================================================

Monday = 1, ... , Sunday = 7

You might consider upgrading DATETONUM to DATE2NUM.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]