Bookmark and Share

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   "Narahari H.S." <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Using _request() when copy pasting from external editor
Date   Fri, 4 Oct 2013 23:56:49 +0800 (SGT)

Thanks a lot Sergiy. I restarted Stata and it works now !
 

----- Original Message -----
From: Sergiy Radyakin <[email protected]>
To: "[email protected]" <[email protected]>
Cc: 
Sent: Friday, 4 October 2013 8:29 PM
Subject: Re: st: Using _request() when copy pasting from external editor

Hello Hari,

type 'mata mata mlib index' and see if the library l_rs_db_utils got installed
and appears in the list. Stata should reindex the libraries automatically,
but there was at least one version that didn't:
http://www.stata.com/statalist/archive/2005-06/msg00865.html

If anybody else is experiencing trouble with it, please respond with detailed
symptoms. So far I tested it in v9.0 and v12.1.

Best, Sergiy Radyakin

On Fri, Oct 4, 2013 at 2:32 AM, Sergiy Radyakin <[email protected]> wrote:
> Hello Hari, type mata mata mlib index and see if the library got installed
> and appears in the list. Stata should reindex the libraries automatically
> but there was at least one version that didn't. If anybody else is
> experiencing trouble with it, please respond with detailed symptoms. So far
> I tested it in v9.0 and v12.1. Best, Sergiy Radyakin
>
> On Oct 4, 2013 12:14 AM, "Narahari H.S." <[email protected]> wrote:
>>
>> Hello Sergiy,
>>
>> Thanks a lot. This is exactly what I was looking for. However, its not
>> working for me. I first did -net install rs_db_utils- and then used your
>> demo code. But I get the following from Stata. Did I miss something or do I
>> need to install anything else? Sorry if my query is too naive :)
>>
>>
>> ******************************************************************************************************
>>
>> . sysuse auto
>>
>> (1978 Automobile Data)
>> .
>> . inputbox a, prompt("Input value (0/1):") title("Selection") defval("0")
>>                  <istmt>:  3499  inputbox() not found
>> r(3499);
>> .
>> . summarize if (foreign==$a)
>> invalid syntax
>> r(198);
>>
>> ******************************************************************************************************
>>
>>
>> Thank you
>> Hari
>>
>>
>>
>> ----- Original Message -----
>> From: Sergiy Radyakin <[email protected]>
>> To: "[email protected]" <[email protected]>
>> Cc:
>> Sent: Thursday, 3 October 2013 10:46 PM
>> Subject: Re: st: Using _request() when copy pasting from external editor
>>
>> 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/
>>
>>
>> *
>> *   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?searchhttp://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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index