geta$p (2) --- fetch arguments for a Pascal program 02/24/82 _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n type string128 = array [1..128] of char; function geta$p ( ap: integer; var str: string128; len: integer) : integer; Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n 'Geta$p' fetches an argument from the Subsystem command line in a format useable by a Pascal program. The arguments are analogous to those used by 'getarg'. 'Ap' is the number of the argument to be fetched: 0 for the command name, 1 for the first argument, 2 for the second, etc. 'Str' is a string to receive the argument, while 'len' is the number of characters allocated to 'str'. The function return value is either the length of the argument string actually returned, or EOF (-1) if there is no argument in that position. To use 'geta$p', it must be declared as a level 1 procedure in the Pascal program: function geta$p ( ap: integer; var str: string128; len: integer) : integer; extern; It may then be called as a function wherever desired. _I_m_p_l_e_m_e_n_t_a_t_i_o_n 'Geta$p' simply calls 'getarg' with the argument pointer, and then calls 'ctop' to convert the result into the proper Pascal format, after it has blank-filled 'str'. _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d str _C_a_l_l_s ctop (2), getarg (2) _B_u_g_s If 'len' is an odd number, 'geta$p' will at most, return 'len - 1' characters of the argument. geta$p (2) - 1 - geta$p (2) geta$p (2) --- fetch arguments for a Pascal program 02/24/82 _S_e_e _A_l_s_o getarg (2), geta$f (2), geta$plg (2) geta$p (2) - 2 - geta$p (2)