home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / insidetp / 1990_04 / caltest.pas next >
Pascal/Delphi Source File  |  1990-03-19  |  733b  |  39 lines

  1. PROGRAM CalTest;
  2.  
  3. USES DOS,CRT,CalUnit;
  4.  
  5. VAR
  6.    MyCalendar: Calendar;
  7.    TYear,TMonth,Tday,TDOW: Word;
  8.  
  9. BEGIN
  10.    ClrScr;
  11.    GetDate(TYear,TMonth,Tday,TDOW);
  12.    WITH MyCalendar DO
  13.    BEGIN
  14.       WriteLn('    Current Month''s Calendar');
  15.       WriteLn;
  16.       Init(TMonth, TYear);
  17.       WHILE (TMonth <> 0) DO
  18.     BEGIN
  19.       WriteLn;
  20.       WriteLn('   Enter a Month and Year');
  21.       WriteLn('(Separate values by a space)');
  22.       WriteLn;
  23.       WriteLn('      exm.      3 1990');
  24.       WriteLn;
  25.       Write     ('   or 0 0 to quit: ');
  26.       ReadLn(TMonth, TYear);
  27.       IF TMonth <> 0 THEN
  28.          BEGIN
  29.            ClrScr;
  30.            SetYear(TYear);
  31.            SetMonth(TMonth);
  32.            DrawCalendar
  33.          END
  34.     END
  35.    END;
  36.    ClrScr
  37. END.
  38.  
  39.