

            ctov (2) --- convert EOS-terminated string to varying string  03/01/83


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function ctov (str, i, var, len)
                 character str (ARB)
                 integer i, len
                 packed_char var (len)

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Ctov'  converts _S_o_f_t_w_a_r_e _T_o_o_l_s style EOS-terminated strings
                 to PL/I style "character varying" strings.  Character  vary-
                 ing  strings consist of a one-word length field, followed by
                 up to 32767 words of packed character data.

                 The argument 'str' contains the EOS-terminated string to  be
                 converted.   The integer 'i' gives the position of the first
                 character in the string to be converted, i.e.  the  starting
                 point  of  the  substring  to be packed.  'Var' is the array
                 which is to receive the character varying string, and  'len'
                 is  the  number  of  words  in  'var'  available for holding
                 characters plus one (for the string length  word).   Conver-
                 sion  starts  at  the  'i'th position in 'str' and continues
                 until an EOS is encountered in 'str' or 'var' is  completely
                 filled.   The  function  return  is the number of characters
                 packed.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 'Ctov', like 'ctop', makes repeated calls  on  the  standard
                 macro  'spchar'  to  pack  characters  into  the destination
                 array.  Once all characters in the string have been  packed,
                 or no room remains in the destination, 'ctov' sets the first
                 word of the destination array to the number of characters it
                 contains and returns this number as the function value.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 i, var


            _S_e_e _A_l_s_o

                 other conversion routines ('cto?*' and '?*toc') (2)










            ctov (2)                      - 1 -                      ctov (2)


