The pattern
latestageatbirth(default=50)
isn't correct for options. See -help syntax-. Try e.g.
latestageatbirth(real 50)
Nick
On Fri, Jan 11, 2013 at 7:31 PM, Stephen Cranney <scranney@sas.upenn.edu> wrote:
> 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)
> ]
>
*
* 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/