Last Friday of each month: Difference between revisions

Content added Content deleted
(→‎{{header|C sharp}}: Added implementation in C#.)
m (→‎{{header|REXX}}: removed some blank lines, changed box gylphs. -- ~~~~)
Line 779: Line 779:
This REXX program will find the last day-of-week (for any day) of all the months for any year.
This REXX program will find the last day-of-week (for any day) of all the months for any year.
<lang rexx>/*REXX program displays dates of last Fridays of each month for any year*/
<lang rexx>/*REXX program displays dates of last Fridays of each month for any year*/

parse arg yyyy
parse arg yyyy
do j=1 for 12
do j=1 for 12
Line 785: Line 784:
end /*j*/
end /*j*/
exit /*stick a fork in it, we're done.*/
exit /*stick a fork in it, we're done.*/
/*┌────────────────────────────────────────────────────────────────────┐

/*┌────────────────────────────────────────────────---─────────────────┐
│ lastDOW: procedure to return the date of the last day-of-week of │
│ lastDOW: procedure to return the date of the last day-of-week of │
│ any particular month of any particular year. │
│ any particular month of any particular year. │
Line 811: Line 809:
│ the month, bypassing the leapday mess). The last day-of-week is │
│ the month, bypassing the leapday mess). The last day-of-week is │
│ then obtained straightforwardly, or via subtraction. │
│ then obtained straightforwardly, or via subtraction. │
└────────────────────────────────────────────────────────────────────┘*/
└───────────────────────────────────────────────────---──────────────┘*/

lastdow: procedure; arg dow .,mm .,yy . /*DOW = day of week*/
lastdow: procedure; arg dow .,mm .,yy . /*DOW = day of week*/
parse arg a.1,a.2,a.3 /*orig args, errmsg*/
parse arg a.1,a.2,a.3 /*orig args, errmsg*/