Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Advanced use of the shell command


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Advanced use of the shell command
Date   Thu, 26 Jun 2008 13:15:22 -0400

Hello Martin,

I think it depends on your text editor, not on the -shellout-. E.g. it
must be an MDI confirming application, or something similar.  E.g.
notepad.exe will not be able to load multiple documents into a single
instance simply because it is not capable of doing so. In general,
Windows will start another copy of an application, and it is it's
responsibility to look for another copy of itself, and decide what to
do if another instance is running. (E.g. some accounting programs will
refuse to run if there is another copy already running). Your editor
might have an option that controls its behaviour, something like "Open
each document in a new window".

It is also not straightforward, what do you mean by redundant
programs. E.g. if I open multiple PDFs, after all one copy of Acrobat
Reader will be running, but I will have multiple buttons (one for each
document) in the taskbar. This is also application-specific.

ConTEXT editor will create one button in the taskbar and will load
multiple documents into tabs. May be this is the behaviour you are
looking for. It will also notify you if your files were changed, while
you switched to another program etc. So if this is your output file,
you don't need to reopen it all the time. But as always there are pros
and cons with this editor.

Best regards,
   Sergiy Radyakin.


On 6/26/08, Martin Weiss <martin.weiss@uni-tuebingen.de> wrote:
> I do not want to hijack this interesting thread but is there a way to tell
> -shellout- not to open a new instance of the program it calls? -shellout
> using foo.tex- brings up a new instance of my editor which clutters my
> session with a lot o f redundant programs...
>
> Martin Weiss
> _________________________________________________________________
>
> Diplom-Kaufmann Martin Weiss
> Mohlstrasse 36
> Room 415
> 72074 Tuebingen
> Germany
>
> Fon: 0049-7071-2978184
>
> Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130
>
> Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131
>
> SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945
>
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sergiy Radyakin
> Sent: Thursday, June 26, 2008 5:24 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: Advanced use of the shell command
>
> Hello Roy,
>
> thank you for your interest. However, shellout uses winexec, and hence
> does not wait for the program that has been launched to complete. The
> OS (command processor) does wait, but this happens in parallel to the
> Stata process, which continues executing the do file. An old trick to
> organize a wait is to wait for a marker file to be created, but this
> may never happen if the process being launched crashes. (I may not
> know in advance, how much time it will need for FooBar.exe to
> complete, hence timeouts are not applicable).
>
> I also don't see how the "<" can make a difference. Try:
> dir
> dir /s
> dir /s < nul
>
> Using "<" with a parameters file does not replace the parameters
> already present in the command line. hence the last two commands will
> produce the same output, even though it is (generally) different from
> the output of the first command. So I can't remove /C which is added
> by Stata in the command line, unless I can change the code of
> FooBar.exe to skip the first parameter.
>
> But, just out of curiosity, what is a "Windows clone running on Linux"?
>
>
> Thank you,
>   Sergiy Radyakin
>
>
>
> On 6/26/08, Roy Wada <roywada@hotmail.com> wrote:
> >
> > >I have three questions regarding the use of the shell command in Stata
> > >for Windows. This is rather technical, and might be interested to just
> > >a few readers, but I would really want to know the answers.
> >
> > -shellout- might take you halfway there. The codes are posted here:
> >
> > http://datasets.org/statalist/archive/2007-11/msg00923.html
> > http://datasets.org/statalist/archive/2007-11/msg00990.html
> >
> > Note that "<" is a way to upload predefined parameters from a text file.
> >
> > Someone told me it doesn't work on a Windows clone running on Linux.
> > It works fine on my Windows XP machine.
> >
> > The latest version on SSC (bundled under -outreg2-) comes with a
> > help file.
> >
> > Roy
> >
> > _________________________________________________________________
> > Need to know now? Get instant answers with Windows Live Messenger.
> >
> http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL
> _Refresh_messenger_062008
> > *
> > *   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/
> >
> *
> *   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/
>
> *
> *   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/
>
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index