Calendar - for "REAL" programmers: Difference between revisions

m
m (→‎{{header|Phix}}: added syntax colouring, marked p2js incompatible)
Line 2,687:
 
So, the first task is to take a copy of [[Calendar#Phix|Calendar]] and make it output uppercase. Change the line
<!--<lang Phix>(notonlinephixonline)-->
<span style="color: #008080;">return</span> <span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">left</span><span style="color: #0000FF;">)&</span><span style="color: #000000;">s</span><span style="color: #0000FF;">&</span><span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">' '</span><span style="color: #0000FF;">,</span><span style="color: #000000;">right</span><span style="color: #0000FF;">)</span>
<!--</lang>-->
Line 2,738:
Lastly, the calendar example includes builtins\timedate.e, which contains some lower-case definitions. So copy it to (say) TIMEDATEUPPER.E and change adjust_timedate, timedelta, days (the 2nd param to timedelta), and format_timedate to their uppercase equivalents, and of course change that include to <code>INCLUDE BUILTINS\TIMEDATEUPPER.E</code>.
 
There are probably even simpler changes to ptok.e/pttree.e that would make everything case insensitive, but locating those is left as an exercise for the reader.<br>
Likewise the changes that would be needed to pwa/p2js have been left as an exercise for the reader, but are assumed similarly trivial.
 
You don't actually have to repackage (p -c p) to test this, just run p p test.exw - technically slower by a second or so but only really noticeable long-term.
7,796

edits