Advertisement
tolikpunkoff

sleep.pas

Feb 2nd, 2019
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.59 KB | None | 0 0
  1. program waiter;
  2. Uses Sysutils;
  3.  
  4. var Time, Code:Integer; MS:Cardinal;
  5.  
  6. BEGIN
  7.  
  8.     if ParamCount > 0 then
  9.     begin
  10.         val (ParamStr(1), Time, Code);
  11.         if Code <> 0 then
  12.         begin
  13.             Writeln ('Not number (error at position ', Code, ')');
  14.             Writeln ('Use sleep.exe <count (sec.)>');
  15.         end
  16.         else
  17.         begin
  18.             Time:=Abs(Time);
  19.             MS:=Time*1000;
  20.             Writeln ('Wait ',Time, ' s.');
  21.             Sleep(MS);
  22.         end;
  23.     end
  24.     else
  25.     begin
  26.         Writeln ('Use sleep.exe <count (sec.)>');
  27.     end;
  28. END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement