

            parsdt (2) --- parse a date in mm/dd/yy format           03/20/80


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function parsdt (str, i, month, day, year)
                 character str (ARB)
                 integer i, month, day, year
                 
                 Library: vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Parsdt' examines the string passed to it in 'str', starting
                 at  position 'i' and attempts to interpret it as a Gregorian
                 date.  The string being examined is expected to be in any of
                 three formats:  a single integer, which is interpreted as  a
                 day  in  the  current  month  of the current year; a pair of
                 integers separated by a slash (/), which is interpreted as a
                 month of the current year followed  by  a  day  within  that
                 month;  or  three  integers  separated  by slashes, which is
                 interpreted in the obvious way.

                 If the string is found to be  a  valid  date  (both  syntac-
                 tically  and semantically), the arguments 'month', 'day' and
                 'year' are set appropriately, and  OK  is  returned  as  the
                 function  value.   Otherwise, the contents of 'month', 'day'
                 and 'year' are unpredictable and  ERR  is  returned  as  the
                 function  value.   In  all  cases,  the  string index 'i' is
                 advanced beyond the last character examined in the string.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 After skipping leading blanks and checking  the  first  non-
                 blank  character  to  be  sure it is a digit, 'parsdt' calls
                 'ctoi' to convert the string to  an  integer.   As  long  as
                 there  are  trailing  slashes,  'ctoi'  is called repeatedly
                 until a month, day and year have been  parsed.   If  at  any
                 point  a  trailing  slash is not encountered, 'parsdt' calls
                 'date' to retrieve the current date and parses the remaining
                 items from that string.


            _C_a_l_l_s

                 ctoi, date


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 i, month, day, year


            _S_e_e _A_l_s_o

                 parstm (2)



            parsdt (2)                    - 1 -                    parsdt (2)


