Statalist


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

Re: st: How to input in a do file


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to input in a do file
Date   Tue, 28 Jul 2009 16:23:19 -0400

Dear Tiago,

using -input- in this case is inefficient. There are several other
ways to do this:
1)
capture window stopbox rusure "Do you want to pursue option A?"
if !_rc{
  // do option A
}
else {
  // do option B
}
2)
 display "Are you sure you want to pursue option A? (Y/N)" _request(answer)
 if "$answer"=="Y" {
  // do option A
}
else {
  // do option B
}

Hope this helps,
    Sergiy Radyakin

On Tue, Jul 28, 2009 at 3:22 PM, Tiago Dias<tiagorossidias@yahoo.com.br> wrote:
> Hi again.
> I'm doing a little do-file and I have a problem wich I can't solve.
> At a certain point, after some calculations, I need to stop the program and wait the user decide over option A or option B.
> I thought about using -input- 'tempvar' and verifying the value of 'tempvar', but when I use -input- in the middle of the do file I get an error (r(612) - unexpected end of file) and the do-file ends.
>
> Does anyone has a idea about what to do?
> Thanks.
>
>
>      ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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