Anonymous user
Calendar - for "REAL" programmers: Difference between revisions
→{{header|Elena}}
PatGarrett (talk | contribs) m (→{{header|360 Assembly}}: Superfluous blanks suppressed) |
|||
Line 819:
=={{header|Elena}}==
ELENA 3.x :
<lang elena>#import system'text.
#import system'routines.
#import system'calendar.
Line 827:
#import extensions'routines.
{
[
theMonth := aMonth.
Line 846:
]
[
theRow
theDate := Date new &year:(theYear int) &month:(theMonth int) &day:1.
DayNames run &each: aName
Line 854:
]
[
theLine clear.
if (theDate month == theMonth)
theLine write:" " &length:(((theDate dayOfWeek) => 0
control do:
[
theLine write:(theDate day literal) &paddingLeft:3 &with:#32.
theDate := theDate add &days:1.
]
Line 870 ⟶ 871:
].
if (aLength < 21)
theRow += 1.
]
{
available = theRow < 7.
readIndex &vint:anIndex [ anIndex
write &index:anIndex
[
if (anIndex <= theRow)
[
]
get =
}.
[
anOutput write:(MonthNames @(theMonth - 1)) &padding:21 &with:#32.
]
[
anOutput write:(theLine literal).
Line 905 ⟶ 907:
}
{
[
theYear := aYear int.
Line 916 ⟶ 918:
]
[
anOutput write:"[SNOOPY]" &padding:(theRowLength * 25) &with:#32.
Line 923 ⟶ 925:
anOutput writeLine writeLine.
[ Array new &length:theRowLength set &every:(&index:j)
[ CalendarMonthPrinter new &year:(theYear int) &month:((i * theRowLength + j + 1) int) ]].
Line 934 ⟶ 936:
aMonth printTitleTo:anOutput.
anOutput write:" ".
].
anOutput writeLine.
Line 943 ⟶ 944:
[
aPrinter printTo:anOutput.
anOutput write:" ".
].
Line 950 ⟶ 952:
]
}
▲#symbol program =
[
aCalender printTo:console.
|