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PMtX tK t:SUN PtMONm PtTUEL PtWED+ PutyTHU PTtXFRI Pi3tt7SAT PHtS]ÃsW}%PY+}HAFQ_s2 u J >_s /?YItF]UUtP@PTtJ]UU%$JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECD ;1[Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec]Starting Month: ~&~ 0 THEN Days_In_Month := 29 ELSE IF Year MOD 400 = 0 THEN Days_In_Month := 29; END; END; { Init_Month } PROCEDURE Print_Margin; BEGIN WRITE(Pr,Tab); END; { Print_Margin } PROCEDURE Print_Dashes; CONST DASH10 = '----------'; BEGIN Print_Margin; FOR X := SUN TO SAT DO WRITE(Pr,Bar,DASH10); WRITELN(Pr,Bar); END; { Print_Dashes } PROCEDURE Start_Line2; BEGIN Print_Margin; Day_Of_Month := 1; FOR X := SUN TO SAT DO IF X < Day_Of_Week THEN WRITE(Pr,Bar,Tab) ELSE BEGIN WRITE(Pr,Bar,Day_Of_Month:3,Tab); Day_Of_Month := Day_Of_Month + 1; END; WRITELN(Pr,Bar); END; { Start_Line2 } PROCEDURE Print_Middle; BEGIN Print_Margin; FOR X := SUN TO SAT DO IF Day_Of_Month > Days_In_Month THEN WRITE(Pr,Bar,Tab) ELSE BEGIN WRITE(Pr,Bar,Day_Of_Month:3,Tab); Day_Of_Month := Day_Of_Month + 1; Day_Of_Week := X; END; WRITELN(Pr,Bar); END; { Print_Middle } PROCEDURE Print_Rest; VAR Y : INTEGER; BEGIN FOR Y := 1 TO MaxLines DO BEGIN Print_Margin; FOR X := SUN TO SAT DO WRITE(Pr,Bar,Tab); WRITELN(Pr,Bar); END; END; { Print_Rest } PROCEDURE Print_Header; BEGIN Print_Margin; WRITE(Pr,Esc,'W',CHR(1)); { Wide Print } WRITE(Pr,MonthNames[ORD(Month)] : 35); WRITELN(Pr,Year:5); WRITE(Pr,Esc,'W',CHR(0)); WRITELN(Pr); WRITE(Pr,' '); WRITE(Pr,'SUN':6,Tab); WRITE(Pr,'MON':6,Tab); WRITE(Pr,'TUE':6,Tab); WRITE(Pr,'WED':6,Tab); WRITE(Pr,'THU':6,Tab); WRITE(Pr,'FRI':6,Tab); WRITE(Pr,'SAT':6,Tab); WRITELN(Pr); END; { Print_Header } BEGIN { Print_Month } New_Month := TRUE; Init_Month; Print_Header; FOR J := 1 TO 6 DO BEGIN Print_Dashes; IF New_Month THEN Start_Line2 ELSE Print_Middle; New_Month := FALSE; Print_Rest; END; Print_Dashes; END; { Print_Month } PROCEDURE Reset_Printer; BEGIN WRITE(Pr,Esc,'@'); CLOSE(Pr); END; { Reset_Printer } PROCEDURE Get_Month; TYPE MonListType = STRING[36]; CONST MonList : MonListType = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'; VAR M : STRING[3]; X : BYTE; BEGIN WRITELN; WRITELN('[Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec]'); WRITE('Starting Month: '); READLN(M); IF M = '' THEN BEGIN LowVideo; HALT; END; FOR X := 1 TO LENGTH(M) DO M[X] := UPCASE(M[X]); X := POS(M,MonList); IF X = 0 THEN Get_Month ELSE Month := MonthType((X - 1) DIV 3); END; { Get_Month } PROCEDURE Get_Year; BEGIN WRITELN; WRITELN('[Four digit Year between 1593 and 9999]'); WRITE('Starting Year: '); READLN(Year); IF (Year < 1583) OR (Year > 9999) THEN Get_Year; END; { Get_Year } PROCEDURE Get_Count; BEGIN WRITELN; WRITE('Number of months to print [greater than zero]: '); READLN(Count); IF Count < 1 THEN Get_Count; END; { Get_Count } PROCEDURE Get_DOW(Y : YearType; M : MonthType); VAR X,Century,Year,Month,Day : INTEGER; BEGIN Year := Y; Month := ORD(M) + 1; Day := 1; Month := Month - 2; IF Month < 1 THEN BEGIN Month := Month + 12; Year := Year - 1; END; Century := Year DIV 100; Year := Year MOD 100; X := ((26*Month-2) DIV 10 + Day + Year + Year DIV 4 + Century DIV 4 - (Century * 2)) MOD 7; Day_Of_Week := DOWType(X); END; { Get_DOW } PROCEDURE Init_Printer; VAR X,Y : INTEGER; BEGIN ASSIGN(Pr,'LST:'); REWRITE(Pr); WRITE(Pr,Esc,'O'); { SKIP Off } { Set up tabstops for doing the spacing } Y := 3; WRITE(Pr,Esc,'D'); WRITE(Pr,CHR(Y)); FOR X := 0 TO 7 DO WRITE(Pr,CHR(Y+(11*X))); WRITE(Pr,CHR(0)); WRITE(Pr,Esc,'G'); { Double Strike } END; { Init_Printer } BEGIN { MAIN } ClrScr; WRITELN('Calendar Version 2.1'); WRITELN('Prints a calendar from a given starting Month'); WRITELN('for as many months as desired'); WRITELN; REPEAT Get_Month; Get_Year; Get_Count; Get_DOW(Year,Month); Init_Printer; FOR L := 1 TO Count DO BEGIN Print_Month(Month,Year,Day_Of_Week); IF Month = DEC THEN BEGIN Month := JAN; Year := Year + 1; END ELSE Month := SUCC(Month); IF Day_Of_Week = SAT THEN Day_Of_Week := SUN ELSE Day_Of_Week := SUCC(Day_Of_Week); WRITE(Pr,FormFeed); END; WRITELN; Reset_Printer; UNTIL FALSE; { Exit in Get_Month on Null } END.