

            getarg (2) --- fetch command line arguments              03/23/80


            _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

                 integer function getarg (n, arg, arg_len)
                 integer n, arg_len
                 character arg (arg_len)

                 Library:  vswtlb (standard Subsystem library)


            _F_u_n_c_t_i_o_n

                 'Getarg'  is  used to retrieve the arguments supplied on the
                 command line that invoked a program.  The first argument  is
                 the  ordinal  of  the command argument to be fetched:  1 for
                 the first, 2 for the second, etc.  The second argument is  a
                 string  to  receive  the command argument being fetched; the
                 third argument is the maximum length  of  the  string.   The
                 function  return  from 'getarg' is the length of the command
                 argument fetched, if the fetch was successful;  EOF  if  the
                 argument  could  not  be fetched.  Argument 0 is the name of
                 the command calling 'getarg'.


            _I_m_p_l_e_m_e_n_t_a_t_i_o_n

                 The Subsystem command interpreter maintains the list of com-
                 mand arguments in its linked-string storage area.   'Getarg'
                 uses  the  array  of pointers into this area supplied by the
                 command interpreter to locate  the  desired  argument,  then
                 copies the characters to the user's buffer one-by-one.


            _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

                 arg


            _B_u_g_s

                 A  program can have at most 256 arguments.  There is no con-
                 venient way to find out how many arguments  have  been  sup-
                 plied  on an invocation without searching through the entire
                 list with calls to 'getarg'.


            _S_e_e _A_l_s_o

                 chkarg (2), getkwd (2)










            getarg (2)                    - 1 -                    getarg (2)


