1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4    *                                                         *
 5    * Copyright (c) 1972 by Massachusetts Institute of        *
 6    * Technology and Honeywell Information Systems, Inc.      *
 7    *                                                         *
 8    *********************************************************** */
 9 
10 
11 pause: proc;                                                /* program to pause for n seconds  */
12 
13 /* Modified 8-17-82 by M. Toussaint to check the number of arguments. */
14 
15 dcl  cu_$arg_count ext entry (fixed bin),
16      cu_$arg_ptr ext entry (fixed bin, ptr, fixed bin, fixed bin),
17      com_err_ entry options (variable),
18      cv_dec_check_ entry (char (*), fixed bin) returns (fixed bin (35)),
19      timer_manager_$sleep ext entry (fixed bin (71), bit (2));
20 
21 dcl  arg_ptr ptr;
22 
23 dcl  arg char (arg_len) based (arg_ptr);
24 
25 dcl (arg_len, code, count, time) fixed bin, pause_time fixed bin (71);
26 
27 dcl  error_table_$wrong_no_of_args fixed bin (35) external;
28 
29 
30 
31           call cu_$arg_count (count);
32 
33           if count = 0 then pause_time = 10;                /* pause for 10 seconds if no argument given */
34           else if count > 1 then do;                        /* make sure no more than one argument was given */
35                code = error_table_$wrong_no_of_args;
36                call com_err_ (code, "pause", "^/Usage:  pause {seconds}");
37                return;
38           end;
39           else do;
40                call cu_$arg_ptr (1, arg_ptr, arg_len, code);
41                time = cv_dec_check_ (arg, code);
42                if code ^= 0 then do;
43                     call com_err_ (0, "pause", " ""^a"" is not a decimal number of seconds.", arg);
44                     return;
45                end;
46                pause_time = time;
47           end;
48 
49           call timer_manager_$sleep (pause_time, "11"b);
50 
51           return;
52 
53      end;