Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: One help file for two program


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: One help file for two program
Date   Fri, 22 Mar 2013 14:27:35 -0400

John Antonakis <John.Antonakis@unil.ch>:
I believe the redirection of -help ttesti- to -help ttest- is done by
-view- which is internal, accessing a file of associations made by
(maybe) Ken Higbee at Statacorp (someone more knowledgeable can
clarify).  Assuming you cannot make -help- point to a different file,
you can create two identical copies of the same help file, called
john.sthlp and johni.sthlp say, each with help for both commands. Or
better: you can INCLUDE john as the whole substance of johni.sthlp
instead--see
help smcl##repeated_material

I was suggesting a different approach altogether: one command that can
handle both immediate calculations and calculations on data.  You
could have two other commands called by -john- e.g. -johnd- and
-johni- but have all the help in john.sthlp and have john do all the
parsing required to determine whether to call  -johnd- or -johni- as
required.

On Fri, Mar 22, 2013 at 1:54 PM, John Antonakis <John.Antonakis@unil.ch> wrote:
> Thanks Austin. I am not clear on what you are saying exactly; if you could
> briefly elaborate that would be great?
>
> Also, does your advice hold if one of the commands exists already (e.g.,
> ttest)? In that case is it just best to do two commands with two (same) help
> files?

> On 22.03.2013 18:48, Austin Nichols wrote:
>>
>> John Antonakis <John.Antonakis@unil.ch>
>> Sorry -- I started to write an email and then sent accidentally way
>> too early.  Was going to suggest writing one command that points to
>> two versions, one immediate and one that operates on data in memory.
>>
>> On Fri, Mar 22, 2013 at 1:44 PM, Austin Nichols <austinnichols@gmail.com>
>> wrote:
>>>
>>> John Antonakis <John.Antonakis@unil.ch>
>>> adoedit h
>>>
>>> shows one way:
>>>
>>> program h
>>>          help `0'
>>> end
>>>
>>>
>>> On Fri, Mar 22, 2013 at 1:36 PM, John Antonakis <John.Antonakis@unil.ch>
>>> wrote:
>>>>
>>>> Hi:
>>>>
>>>> How does one go about linking one help file to two programs (e.g., the
>>>> program, "ttest" and its immediate form, "ttesti")?
>>>>
>>>> That is, when one types "help ttest" or "help ttesti" it will open the
>>>> same
>>>> helpfile (associated with say ttest).
>>>>
>>>> I have been looking into how it is done in help files but I can't find
>>>> the
>>>> trick.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index