Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Running the db command before my program continues

From   James Hassell <>
Subject   st: Re: Running the db command before my program continues
Date   Wed, 26 Oct 2005 10:15:50 -0500

Carlos wrote:

I made a program in which I tried to interact with the user. I used a dialog box
in which I request the user to press a button. If the user press the button,
the .dlg program changes a global macro content. However, It does it after all
the other program runs. I would like it to do it before the program continues.


It looks like Carlos really wants is a modal dialog box that stops stata do/ado
execution, so that the user can look at a tabulation, and verify that a 
variable is okay.  The dialog language is not well suited for this task, but 
I believe that Carlos can do what he wants with the -window stopbox- command.

Here is an example based on the original example provided by Carlos.

use "vivienda_todas.dta", clear

foreach var of varlist  a1 a2  {
	tab `var'
	capture window stopbox rusure "Ok to use this variable?"
	if _rc {
		display "`var' has a problem"
		// do other steps if necessary

I hope this helps.

James Hassell

*   For searches and help try:

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