

            parstm (2) --- convert time-of-day to seconds past midnight  03/28/80


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function parstm (str, i, val)
                 character str (ARB)
                 integer i
                 long_int val

                 Library:  vswtlb  (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Parstm' converts a standard textual time-of-day representa-
                 tion  into  the  number  of  seconds  since  midnight.   The
                 argument 'str' starting at position 'i' is assumed to be  an
                 EOS-terminated  string  containing  the  time-of-day  in the
                 format "<hours>[:<minutes>[:<seconds>]]['am'|'pm']".   'Val'
                 is  a long integer variable which receives the result of the
                 conversion.  The function return is  OK  if  the  conversion
                 succeeded, ERR otherwise.  As with most conversion routines,
                 the  position  argument 'i' is updated to point to the first
                 character in the input string that is  not  a  part  of  the
                 time-of-day.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Parstm' simply scans the string accumulating the components
                 of  the  time  as it goes, calculating 'val' in the process.
                 Errors occur if there is no leading digit  or  if  the  time
                 specified yields more than 86,400 seconds.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 i


            _C_a_l_l_s

                 ctoi, mapdn


            _B_u_g_s

                 Does  not  check  the time string for legality.  Behavior at
                 midnight and noon may not be correct.


            _S_e_e _A_l_s_o

                 parsdt (2)






            parstm (2)                    - 1 -                    parstm (2)


