; docformat = 'rst' ;+ ; Routine to test various routines that give information about parameters passed ; into a routine (N_PARAMS, N_ELEMENTS, KEYWORD_SET, and ARG_PRESENT). ; ; :Params: ; a : in, out, optional, type=any ; example parameter ; b : in, out, optional, type=any ; example parameter ; c : in, out, optional, type=any ; example parameter ; ; :Keywords: ; keyword : in, out, optional, type=any ; example keyword ;- pro mg_param_test, a, b, c, keyword=keyword compile_opt strictarr print, 'nparams() = ' + strtrim(n_params(), 2) print, 'n_elements(a) = ' + strtrim(n_elements(a), 2) print, 'n_elements(b) = ' + strtrim(n_elements(b), 2) print, 'n_elements(c) = ' + strtrim(n_elements(c), 2) print, 'n_elements(keyword) = ' + strtrim(n_elements(keyword), 2) print, 'keyword_set(keyword) = ' + strtrim(keyword_set(keyword), 2) print, 'arg_present(keyword) = ' + strtrim(arg_present(keyword), 2) end ; main-level example mg_param_test, 1, [0, 1, 2], /keyword end