home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / dosex / ex3.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  340 b   |  24 lines

  1. Program Example3;
  2. uses Dos;
  3.  
  4. { Program to demonstrate the GetTime function. }
  5.  
  6. Function L0(w:word):string;
  7. var
  8.   s : string;
  9. begin
  10.   Str(w,s);
  11.   if w<10 then
  12.    L0:='0'+s
  13.   else
  14.    L0:=s; 
  15. end;
  16.  
  17. var
  18.   Hour,Min,Sec,HSec : word;
  19. begin
  20.   GetTime(Hour,Min,Sec,HSec);
  21.   WriteLn('Current time');
  22.   WriteLn(L0(Hour),':',L0(Min),':',L0(Sec));
  23. end.
  24.