Anonymous user
Calendar - for "REAL" programmers: Difference between revisions
m
→{{header|REXX}}: re-did the section header comments, change output templete, removed extra blank lines. -- ~~~~
m (→{{header|Ada}}) |
m (→{{header|REXX}}: re-did the section header comments, change output templete, removed extra blank lines. -- ~~~~) |
||
Line 496:
=={{header|REXX}}==
This is essentially the same REXX program as for the CALENDAR task, but written entirely in uppercase. Indeed,
<br>
<br><br>From the task's description, I took it to mean the program was to be in all uppercase, but the output was▼
<br>
▲<br><br>From the task's description, I took it to mean the program was to be in all uppercase, but
<br>long ago, the printers (if not supporting lowercase), would print lowercase as uppercase (with the FOLD option).▼
▲<br>the output was still supposed to look pretty. Even so, on the printers that I grew up on,
<br><br>The other REXX program made use of lowercase letters for determining the minimum length of any of the options▼
▲<br>the printers (if not supporting lowercase), would print lowercase as uppercase (the FOLD option).
<br>
▲<br><br>The other REXX program made use of lowercase letters for determining the minimum length of
▲<br>any of the options (from the command line), and a few stupid tricks were used to accomplish this.
<br>[Note: the command line may also be all uppercase.]
<br><br>In any case, both versions of the programs' output are identical (but the second REXX
<br>
<lang rexx>/*REXX PROGRAM TO SHOW ANY YEAR'S (MONTHLY) CALENDAR (WITH/WITHOUT GRID)*/▼
▲/*REXX PROGRAM TO SHOW ANY YEAR'S (MONTHLY) CALENDAR (WITH/WITHOUT GRID)*/
@ABC=
DO J=0 TO 255;_=D2C(J);IF DATATYPE(_,'L') THEN @ABC=@ABC||_;END
Line 678 ⟶ 675:
PUT:_=ARG(1);_=TRANSLATE(_,,'_'CHK);IF \GRID THEN _=UNGRID(_);IF LOWERCASE THEN _=LOWER(_);IF UPPERCASE THEN UPPER _;IF SHORTEST&_=' ' THEN RETURN;CALL TELL _;RETURN
TELL:SAY ARG(1);RETURN
UNGRID:RETURN TRANSLATE(ARG(1),,"│║─═┤┐└┴┬├┼┘┌╔╗╚╝╟╢╞╡╫╪╤╧╥╨╠╣")</lang>
▲Output when using the input of: <tt> 1/1/1969 (noGrid shortest narrowest)
<pre style="height:40ex;overflow:scroll">
«Snoopy "picture" here»
|