

            vtop (2) --- convert PL/I varying string to packed string  10/26/83


          | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

          |      integer function vtop (vstr, pstr, len)
          |      packed_char vstr (ARB), pstr (len)
          |      integer len

          |      Library:  vswtlb (standard Subsystem library)


          | _F_u_n_c_t_i_o_n

          |      'Vtop' converts a PL/I-compatible "character varying" string
          |      into  a  packed character string.  Character varying strings
          |      consist of a one-word length field, followed by up to  32767
          |      words of packed character data.

          |      The  argument  'vstr'  is the character-varying string to be
          |      converted.  'Pstr' is an array  which  receives  the  packed
          |      string; 'len' gives the number of words available in 'pstr'.

          |      The  function  returns  the number of characters copied into
          |      'pstr'.



          | _I_m_p_l_e_m_e_n_t_a_t_i_o_n

          |      'Vtop' first checks that 'len' is large enough to  allow  it
          |      to store characters in 'str' and then computes the number of
          |      characters  it can copy.  If there is room for characters in
          |      'pstr', 'vtop' copies  successive  words  from  'vstr'  into
          |      'pstr'  until it fills 'len' words or runs out of characters
          |      in 'vstr'.  If 'vstr' contains an odd number of  characters,
          |      'vtop' pads the last word with 0's (an EOS character).


          | _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

          |      pstr


          | _S_e_e _A_l_s_o

          |      other    conversion    routines   ('pto?*'   and   '?*tov'),
          |      particularly 'ptov' (2), 'ctop' (2), 'ptoc' (2), 'vtoc' (2),
          |      and 'ctov' (2)












            vtop (2)                      - 1 -                      vtop (2)


