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: Re: Prompt user of ado file for input & output file names & path


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: Re: Prompt user of ado file for input & output file names & path
Date   Mon, 4 Jul 2011 17:19:10 +0000

<>

As Nick suggested, -dialog- boxes are what you want (especially to allow users to navigate folders); however,  I also like to use -display, request()- (see -help display-) and thought others may find it useful:

******************
di `"  TYPE THE FILEPATH INTO THE COMMAND WINDOW AND THEN PRESS ENTER  "'  _request(ans)
	**puts path in global macro $ans

**echo that back to the user:
window stopbox note `"PATH ENTERS AS :  $ans"'
*or:
di `"PATH ENTERED AS:  $ans"'
******************

- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]


On Jul 4, 2011, at 6:51 AM, Nick Cox wrote:

> . search dialog
> 
> On Mon, Jul 4, 2011 at 12:47 PM, Partho Sarkar <[email protected]> wrote:
> 
>> This may be a very basic question!  I am writing an ado file which
>> will take a data file, perform some operations on the data, and write
>> the resulting data to another file.  How could I write commands to ask
>> the user to enter the names (with paths) of the input & output files?
>> This could be either in the form of displaying a text box/boxes for
>> the file names or, much more preferably, allow the user to browse (in
>> Windows) to the directory & input file.
> 
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index