One good example in which the suggested behavior would be all but
convenient is a program -foo-, starting like
pr foo
vers 12.1
syntax [,bar]
if ("`bar'" == "") [...]
There would have to be an error message whenever the user did not
specify option -bar-, which would make optional options impossible.
Clearly there are other situations in which you want to check whether
a macro is empty or not, and doing so using
cap conf e `bar'
if !(_rc) [...]
seems burdensome.
Best
Daniel
--
I wish the behavior of local macros were changed so that referencing a
macro that has never been defined is an error, rather than treating it
as an empty string.
[...]
A good example:
by `farname1' `varname2' sort: .....[whatever]
will lead to perfectly legal syntax if `farname1' is a typo for
`varname1' and is undefined. But it leads to results other than
intended. If you're lucky the mistake will be immediately obvious in
the results. But sometimes you don't find out until several do-files
later when results based on that start to look whacky.
*
* 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/