Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Suppress -browse- when using -do- to execute commandsfrom a file


From   "Eamonn O'Brien" <Eamonn.O'Brien@icr.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Suppress -browse- when using -do- to execute commandsfrom a file
Date   Mon, 05 Mar 2007 15:03:48 +0000

Thanks for all replies. I used -global- and it works nicely.
Eamonn  

>>> Richard.Atkins@lshtm.ac.uk 05 March 2007 14:29:27 >>>
Extending Sergiy's solution, the branching becomes implicit if the
global-flag directly contains the command.

e.g. replace all -browse- commands with $cond_browse and then define 

global cond_browse = "browse"
or 
global cond_browse = "*" (to comment out anything else on the line)

at the start of each file or in the first file called if it is a
nested
series of files.

Richard Atkins
London School of Hygiene and Tropical Medicine


>>> "Sergiy Radyakin" <Radyakin@aoek.uni-hannover.de> 05/03/2007 14:16
>>>
You can replace -browse- by a call of a new command like

-conditional_browse-

Define it as an ado-file, or in the same file.
Inside you can branch depending, say on a value of a certain global 
FLAG-variable defined at the beginning of your program or changed
depending 
on iterations, etc.

Regards,
   Sergiy


----- Original Message ----- 
From: "Eamonn O'Brien" <Eamonn.O'Brien@icr.ac.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Monday, March 05, 2007 3:08 PM
Subject: Re: st: Suppress -browse- when using -do- to execute
commandsfrom 
afile


> Thanks for the suggestion Svend, however I do not want to duplicate
my
> data management program so that I have one version with -browse -
and
> the other -*browse-. It is important for me to be able to -browse-
for
> the first application of the code, but it is annoying and slower (as
I
> have to close the Data Editor each time) if I must -browse- when
using
> it for the second application.
>
>>>> SJ@SOCI.AU.DK 05 March 2007 13:33:23 >>>
> Eamonn O'Brien wrote:
>
> I have a large Stata data management program that is interspersed
with
> -browse- so I can get a feel for the data as the program is running.
I
> now want to execute the program using -quietly- & -do- followed by
> code
> to capture statistics for another purpose. However with this
> application
> I no longer wish to -browse- the data as the program runs. Therefore
I
> was wondering is there a way to suppress -browse- in this instance?
>
> ---------------------------------------------------------------
>
> I can think of no other way than modifying the do-file, by replacing
> -browse- with the comment -* browse-. In the do-file editor, use
> Ctrl-H to search and replace.
>
> Svend
>
> __________________________________________
>
> Svend Juul
> Institut for Folkesundhed, Afdeling for Epidemiologi
> (Institute of Public Health, Department of Epidemiology)
> Vennelyst Boulevard 6
> DK-8000  Aarhus C, Denmark
> Phone: +45 8942 6090
> Home:  +45 8693 7796
> Email: sj@soci.au.dk 
> __________________________________________
>
> *
> *   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/ 
>
> The Institute of Cancer Research: Royal Cancer Hospital, a
charitable

> Company Limited by Guarantee, Registered in England under Company
No.

> 534147 with its Registered Office at 123 Old Brompton Road, London
SW7 
> 3RP.
>
> This e-mail message is confidential and for use by the addressee
only.  If 
> the message is received by anyone other than the addressee, please
return 
> the message to the sender by replying to it and then delete the
message 
> from your computer and network.
> *
> *   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/ 

*
*   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/ 
*
*   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/

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index