#include <cl.h> loc = cl_argn(cl,index); /* MACRO */ locptr = cl_argN(cl,index); /* MACRO */
The "cl_argn" and "cl_argN" macros both obtain original argument values as specified on the command line. The two are used for different types of options.
For example, consider the following input command line
comm =opt arg =mopt arg1 arg2 arg3 == 0 1 2 3 4 5 6 7
The numbers under the command line show how each argument is numbered. Let's assume that OPT is a symbolic constant indicating the Options Table index of the "=opt" option, and MOPT indicates the index of the "=mopt" option. Then
cl_argn(cl,OPT)
returns the value 1 because that's the "argv" position of the "=opt" keyword. (Note that this is the position of the keyword, not the associated value.)
cl_argN(cl,MOPT)
returns a pointer to a vector containing the numbers
4 5 6
since those are the "argv" positions of three argument values for the "=mopt" option.
cl_argv(cl,MOPT)
returns a pointer to a list of the actual values of the argument strings
"arg1" "arg2" "arg3"
Copyright © 1996, Thinkage Ltd.