Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: What's wrong with -syntax, [now]-?


From   Chris Ruebeck <[email protected]>
To   [email protected]
Subject   st: What's wrong with -syntax, [now]-?
Date   Wed, 22 Jun 2005 14:47:36 -0400

This post seems trivial, but the issue did cost me some non-trivial debugging time.

It seems that an option named "now" won't work. It can't be that option names must have more than three characters, because an option named "yes" works. I used -search now- to see if it's a reserved word, but got no hits. Although -findit now- is an amusing command to issue, it's also not surprising that too many results are returned to be useful for investigation of this minor annoyance.

Eureka (just as I was composing the subject for this post)! I'll continue to post it anyway for the interest of the non-gurus on the list. It's the fact that "now" begins with "no". See /optionally_off/ in -help syntax-.

Chris


. program define junk
1. syntax , [now]
2. di "`now'"
3. end

. junk, now


. program drop junk
. program define junk
1. syntax , [blah]
2. di "`blah'"
3. end

. junk, blah
blah

. program drop junk
. program define junk
1. syntax , [yes]
2. di "`yes'"
3. end

. junk, yes
yes

*
* 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