SHARE
TWEET

sleep.pas

tolikpunkoff Feb 2nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top