Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Command line syntax for optional and required numeric statements
From
Stephen Cranney <[email protected]>
To
[email protected]
Subject
st: Command line syntax for optional and required numeric statements
Date
Fri, 11 Jan 2013 14:31:22 -0500
Hi all,
Apologies if this is simple, but I can't figure this out based on the
documentation.
I'm writing an ado file and am trying to transfer all the macros I
reference inside the file to the command line. Some of the values I want to
make required, and some I want to make optional, but with a default value
if the option is not taken. All of the macros I want in the command line
are numeric.
A representative snippet of the code is below, based on what I've been able
to figure out from the documentation. It gives me an "invalid syntax"
response when I try to "birthsim, startyear(2000)...". It works when I do
it with args, but obviously that's much more cumbersome than syntax in this
context.
program birthsim, rclass
version 11.2
syntax startyear(integer) endyear(integer) [,latestageatbirth(default=50)
]
Thanks in advance,
Stephen
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/