ex6.pp 371 B

123456789101112131415161718192021
  1. Program Example6;
  2. { This program demonstrates the IsValidTime function }
  3. Uses SysUtils,DateUtils;
  4. Var
  5. H,M,S,MS : Word;
  6. I : Integer;
  7. Begin
  8. For I:=1 to 10 do
  9. begin
  10. H:=Random(48);
  11. M:=Random(120);
  12. S:=Random(120);
  13. MS:=Random(2000);
  14. If Not IsValidTime(H,M,S,MS) then
  15. Writeln(H,':',M,':',S,'.',MS,' is not a valid time.');
  16. end;
  17. End.