Bookmark and Share

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

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

Re: st: Using capture drop

From   Nick Cox <>
To   "" <>
Subject   Re: st: Using capture drop
Date   Mon, 27 May 2013 20:39:54 +0100

We can't see the example that is sparking this but usually there is no
mystery here.

The difference between

drop foo


capture drop foo

is that the first will fail if -foo- does not exist, stopping your
program or do-file. The second will just sail on by if -foo- does not
exist. In effect, you are saying

"I don't want -foo-; so if it doesn't exist, that's fine by me."

That is on a level with

"I don't want dirty dishes in my kitchen, so wash them up if there are any"

and you don't expect a message saying

"There are no dirty dishes in your kitchen. What now?"

Of course, you are living dangerously. If -foo- was valuable, you lost
it. it's as if you were saving a dessert for later but somebody threw
it out.

On 27 May 2013 20:21, Michael Stewart <> wrote:
> Hi,
> I am trying to find the utility of command capture drop .
> I see that is being used in foreach loop etc but cannot understand  the logic.
> Can anyone please let me know if there is a good explanation along
> with examples anywhere in the web .
> --
> Thank you ,
> Yours Sincerely,
> Mike.
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

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