Program PTOOLTIM;  {Copyright  R D Ostrander
                               Ostrander Data Services
                               5437 Honey Manor Dr
                               Indianapolis  IN  46241

     This is a demonstration program for the Turbo Pascal subroutine PTOOLTIM
     for time manipulations. Address any questions to the author at the above
     address.                                                                }

{$V-}     { This parameter is necessary in order to pass String parameters
            of other than 11 characters.                                     }

Var
   CurrTime, YourTime : String [11];
   Ch                 : Char;


{$I PTOOLTIM.INC}  {Include statement for PTOOLTIM functions and parameters }


BEGIN

 ClrScr;
 Gotoxy (15,5); Write ('Demonstration of PTOOLTIM procedure.');
 Gotoxy (15,7); Write ('PTOOLTIM and this program are copyrights');
 Gotoxy (15,8); Write ('of R D Ostrander');
 Gotoxy (15,9); Write ('   Ostrander Data Services');
 Gotoxy (15,10); Write ('   5437 Honey Manor Dr');
 Gotoxy (15,11); Write ('   Indianapolis  IN  46241');
 Gotoxy (15,13); Write ('and have been placed in the public domain.');
 Delay (4000);
 ClrScr;

 YourTime := ' ';
 While YourTime = ' ' do
       Begin
            Gotoxy (1, 5); Write ('What time is it?              ');
            Gotoxy (18,5); Read (YourTime);
            Gotoxy (31, 5);
            If PTTValid (YourTime) then
               ClrEol
            else
                Begin
                     Write (YourTime, ' invalid - try again');
                     YourTime := ' ';
                End;
      End;
 CurrTime := PTTHCurr;
 Gotoxy (1, 7); Write ('The current time is : ', CurrTime);
 PTOOLTIM_HH_Disp := 24;
 Gotoxy (17,8); Write ('Aka : ', PTTHtoH (CurrTime),
                       '     in 24 hour format');
 PTOOLTIM_HH_Disp := 12;
 PTOOLTIM_D_Type := 'D';
 Gotoxy (23,9); Write (PTTHtoD (CurrTime):12:6, ' in Decimal Days');
 PTOOLTIM_D_Type := 'H';
 Gotoxy (23,10); Write (PTTHtoD (CurrTime):12:6, ' in Decimal Hours');
 PTOOLTIM_D_Type := 'M';
 Gotoxy (23,11); Write (PTTHtoD (CurrTime):12:6, ' in Decimal Minutes');
 PTOOLTIM_D_Type := 'S';
 Gotoxy (23,12); Write (PTTHtoD (CurrTime):5:0, '        in Decimal Seconds');
 PTOOLTIM_D_Type := 'M';
 Gotoxy (1, 14); Write ('In 95 minutes it will be : ',
                        PTTADD (CurrTime, 95.0));
 Gotoxy (1, 16); Write ('You said ', YourTime,
                        '    ( ', PTTHtoH (YourTime), ' )');
 PTOOLTIM_D_Type := 'S';
 Gotoxy (1, 18); Write ('You were off by ',
                        Abs (PTTComp (YourTime, CurrTime)):5:0, ' Seconds');

Gotoxy (1, 24);

END.