{smcl}
{* 30mar2005}{...}
{cmd:help args}
{hline}
{title:Title}
{p 4 30 2}
{cmd:args} (in {hi:[P] syntax}) {hline 2} Parse Stata syntax positionally
{title:Syntax}
{p 8 13 2}
{cmd:args} {it:macroname1} [{it:macroname2} [{it:macroname3 {it:...}}]]
{title:Description}
{pstd}
{cmd:args} obtains command line arguments. It works on positional
arguments -- the first, second, ... item entered on a command line. The
{help syntax} command is a more comprehensive command that also obtains
command line arguments but does so according to Stata's language grammar. For
an introduction to Stata's language, see {help language}.
{pstd}
{cmd:args} assigns the first command line argument to the local macro
{it:macroname1}, the second argument to {it:macroname2}, and so on. In the
program, you subsequently refer to the contents of the macros by enclosing
their names in single quotes: {cmd:`}{it:macroname1}{cmd:'},
{cmd:`}{it:macroname2}{cmd:'}, etc.
{title:Examples}
{cmd:program define myprog}
{cmd:version {ccl stata_version}}
{cmd:args varname dof beta}
{it:...}
{p 16 18 2}{txt:(program uses macros {hi:`varname'}, {hi:`dof'}, and {hi:`beta'})}{p_end}
{it:...}
{cmd:end}
{cmd:. myprog mpg 32 8.2}
{pstd}
In this case {hi:`varname'} is set to {hi:mpg}, {hi:`dof'} is set to 32,
{hi:`beta'} is set to 8.2.
{title:Also see}
{psee}
Manual: {bf:[P] syntax}
{psee}
Online: {helpb program}, {helpb syntax},
{helpb gettoken}, {helpb tokenize}, {helpb unab}
{p_end}