Stata completely ignores the notab parameter when it is passed to the
program below.
On tracing, notab is always =="" no matter what. Change the parameter
name in the syntax statement to anything else and it works as
expected. Anybody knows what is going on?
I'm running Stata MP v10 born 27 May 2008
Thanks,
cap program drop smtgen
program define smtgen
syntax anything[, Gen(string) Label(string) VLabel(string) replace notab ]
tempvar v
gen `v'=`anything'
local tt "`v'"
if "`gen'" != "" {
if "`replace'" != "" {
cap drop `gen'
}
rename `v' `gen'
if "`label'" != "" {
labe var `gen' "`label'"
}
if "`vlabel'" != "" {
labe val `gen' "`vlabel'"
}
local tt "`gen'"
}
if "`notab'" == "" {
tab `tt'
}
end
*
* 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/