Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: RE: possible bug in the -syntax- command?


From   "Zurab Sajaia" <[email protected]>
To   <[email protected]>
Subject   st: Re: RE: possible bug in the -syntax- command?
Date   Wed, 10 Jan 2007 09:48:09 -0500

The usage of options is documented indeed, but I decided to ask a question since the behavior was different from what was described in the help: "Warning: be careful if the first two letters of the option's name are no, such as the option called notice. You must capitalize at least the N in such cases." and in our case more then N is capitalized.

----- Original Message ----- From: "Nick Cox" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 10, 2007 6:32 AM
Subject: st: RE: possible bug in the -syntax- command?



I guess that you are trying something a little nonstandard
given the special treatment of options whose names begin with
"no", which is documented.

I doubt very much that there is a bug, just a
misunderstanding by Stata!

I suspect that your problems would diminish if
you changed "ADJust" to "ADJust2". You need not
-- indeed should not -- show that extra "2" to users
in the help, but it would distinguish the options
to -syntax-.

A related issue is discussed at
http://www.stata.com/support/faqs/lang/syntax.html

Nick
[email protected]

Zurab Sajaia

I encountered somewhat strange behavior of -syntax- command and was
wandering if it's my fault or there is a problem indeed.
Lets consider this simple program:

capture program drop test
program define test
    syntax [, NOADJust ADJust]

    display "`noadjust'"
    display "`adjust'"
end

test , noadjust
//
it works as expected, but if I change the order of options
"syntax [, ADJust
NOADJust]" then `adjust' local contains the value of option but local
`noadjust' is always empty.

Any ideas why it might happen?
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index