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