

            putdec (2) --- write decimal integer to a file           03/23/80


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 subroutine putdec (n, w, fd)
                 integer n, w
                 file_des fd

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Putdec'  prints  a  decimal  integer  in  a  field of width
                 greater than or equal to the argument 'w'.  The argument 'n'
                 is the integer to be printed; 'w' is the field  width;  'fd'
                 is the file descriptor of the file to be written.  If 'w' is
                 insufficient  to  print the integer, enough additional space
                 on the file is used to insure that an  accurate  representa-
                 tion is printed.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Putdec'  calls 'itoc' to convert the integer to a character
                 representation.   Enough  blanks  are  output  by  calls  to
                 'putch' to right justify the string produced by 'itoc', then
                 the string itself is printed by multiple calls to 'putch'.


            _C_a_l_l_s

                 itoc, putch


            _S_e_e _A_l_s_o

                 itoc (2), encode (2), print (2)






















            putdec (2)                    - 1 -                    putdec (2)


