I wrote
>
> Here is a stab at the problem from another angle:
>
> program def fussydrop
> *! NJC 1.0.0 9 August 2002
> version 7
> syntax varname
> args myvar garbage
> if "`garbage'" != "" { error 198 }
> confirm var `myvar'
> if "`varlist'" == "`myvar'" { drop `myvar' }
> end
>
The `garbage' bit is garbage. The program
will throw you out if there is any trailing garbage
because it won't match the -syntax- statement.
And similarly -confirm-.
program def fussydrop
*! NJC 1.1.0 9 August 2002
version 7
syntax varname
args myvar
if "`varlist'" == "`myvar'" { drop `myvar' }
end
Nick
[email protected]
*
* 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/