Statalist


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

Re: st: RE: Accessing command line parameters


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Accessing command line parameters
Date   Thu, 14 Feb 2008 01:17:05 -0500

Hello Austin,

thank you for the support. The "command line switches" is just one
name out of many for the same thing: in Pascal and Delphi they are
called "Command line parameters" in C# "Command line arguments" and
there might be a dozen of other synonyms for them. This may also vary
by platform.

Your solution will work if the user can change the registry and is
willing to do this (which is not always the case). Also, after
resetting the file associations, Stata will again use "use" instead of
"myuse". Another problem is that someone may just go-by-the-book and
open files directly typing: stata use myfile.dta in which case your
program will never get control.

Anyways, by now I have written a program which tells me what those
command line parameters/switches/arguments were, when Stata was
launched, and I can decide (in a similar fashion as you suggest) how
much memory to reserve. So I am fine now.

Best regards,
         Sergiy

On Wed, Feb 13, 2008 at 11:04 PM, Austin Nichols
<austinnichols@gmail.com> wrote:
> The original question was not recognizable as an FAQ:
> http://www.stata.com/support/faqs/data/setmemory1.html
> since you asked about the "parameters that Stata receives when it is
> launched" but apparently were interested in command line switches.
> See also [GSW] B and C.
>
> You can optimize memory usage by telling Windows to run a different
> command when opening .dta files. Instead of -use- you might specify
> e.g. -my_use- and program your own my_use.ado which sets memory a bit
> larger than you need to open the data, e.g.
>
> prog my_use
>  qui d using `1'
>  loc m=ceil(1.25*r(N)*(r(width)+8)/1e6)
>  qui set mem `m'm
>  use `1'
> end
>
> On Feb 13, 2008 6:12 PM, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> > I am just giving _advice_ -- to repeat a carefully chosen word -- that I
>
> > Sergiy Radyakin
> >
> > Thank you for your answer Nick. It was very helpful.
> >
> > I am just a bit puzzled, since when command line parameters became
> > proprietary secret of Stata Corp???
>
> > On 2/13/08, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> > > My guess is that whatever is not accessible via -creturn list- is in a
> > > private place not accessible to users, or even user-programmers. I
> > could
> > > be very wrong, but that is my guess.
>
> > > Sergiy Radyakin
> > >
> > > I wonder if I can read the parameters that Stata receives when it is
> > > launched. I want to automatically set memory (in the profile.do) to be
> > > at least as big as necessary for the dataset that is being opened
> > > (with a double-click in explorer/windows).
>
> *
> *   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