Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Using _request() when copy pasting from external editor
From
Sergiy Radyakin <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Using _request() when copy pasting from external editor
Date
Thu, 3 Oct 2013 13:16:53 -0400
No Hari, I am afraid Stata only has one buffer for user input and
would not allow you to enter input to the _request while it still has
it occupied with further lines of commands. This does look like a bug
though, since it should not matter whether a command is posted from
keyboard directly or from clipboard in a sequence of other commands.
That's up to StataCorp to fix it or describe as limitation.
As a workaround I suggest you install rs_db_utils (Stata 9.0 or newer,
any platform) and use it instead of _request:
net from http://www.radyakin.org/statalist/2013100301/
For example:
inputbox a, prompt("A=?")
(result is placed in global named 'a')
Produces a dialog like can be seen here:
http://www.radyakin.org/statalist/2013100301/demo.png
And here is your example with auto:
do http://www.radyakin.org/statalist/2013100301/demo.do
(lines can be pasted from the clipboard to resolve exactly your situation).
Hope this helps.
Best, Sergiy Radyakin
On Thu, Oct 3, 2013 at 9:43 AM, Narahari H.S. <[email protected]> wrote:
> Hello everyone,
>
> A simplified version of my code is below (I use Stata 10.1)
>
> *********************************************************
> sysuse auto
> di "Enter value (0/1): " _request(a)
> sum if foreign==$a
> *********************************************************
>
>
> The above works when I "Do" the file from the Stata Do-file editor but if I copy paste the lines from an external editor, Stata does not wait for the user input. Is there a way to make this work when I copy paste?
>
> Thank you
> Hari
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/