Last Friday of each month: Difference between revisions
Content added Content deleted
(add RPL) |
|||
Line 4,012: | Line 4,012: | ||
2012-11-30 |
2012-11-30 |
||
2012-12-28 |
2012-12-28 |
||
</pre> |
|||
=={{header|RPL}}== |
|||
With the release of the HP-48, RPL gained some basic functions for calculating the date, but nothing for directly obtaining the day of the week. |
|||
{{works with|HP|48}} |
|||
≪ { "MON" TUE" "WED" "THU" "FRI" "SAT" "SUN" } |
|||
SWAP 0 TSTR 1 3 SUB POS |
|||
≫ '<span style="color:blue">WKDAY</span>' STO <span style="color:grey">@ ( dd.mmyyyy → 1..7 )</span> |
|||
≪ → year |
|||
≪ { } |
|||
.02 .13 '''FOR''' month |
|||
1 month .13 == DUP .01 month IFTE SWAP year + 1000000 / + + |
|||
DUP <span style="color:blue">WKDAY</span> 1 + 7 MOD 1 + NEG DATE+ 2 TRNC + |
|||
0.01 '''STEP''' 2 FIX |
|||
≫ ≫ '<span style="color:blue">TGIF</span>' STO |
|||
2012 TGIF |
|||
{{out}} |
|||
<pre> |
|||
1: {27.01 24.02 30.03 27.04 25.05 29.06 27.07 31.08 28.09 26.10 30.11 28.12 } |
|||
</pre> |
</pre> |
||