Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Wishlist for Stata 13


From   daniel klein <[email protected]>
To   [email protected]
Subject   Re: st: Wishlist for Stata 13
Date   Thu, 10 Jan 2013 18:37:30 +0100

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index