|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: How to link the help file for a command to its immediate version (or generally add aliases)
From |
Michael McCulloch <[email protected]> |
To |
[email protected] |
Subject |
Re: st: How to link the help file for a command to its immediate version (or generally add aliases) |
Date |
Mon, 29 Sep 2008 10:14:22 -0700 |
I like this approach, and it echoes a thread from last week about
abbreviations. Will those new ado files be saved, or do they need to
be re-invoked for each Stata session? And, if it needs to be
re-invoked, could they all be launched by one do-file such as
"my_abbreviations.do"?
Spelling out a point made by Sergiy Radyakin:
Suppose you write foobar.ado and want Stata to recognise
foo
foob
fooba
as abbreviations. The slow but sure way to do this is by wrapper files
---- foo.ado
program foo
foobar `0'
end
----
---- foob.ado
program foob
foobar `0'
end
----
---- fooba.ado
program fooba
foobar `0'
end
----
In other words, it is easy, if a little tedious. `0' is the way to
echo whatever followed the command name to the command being called.
It would be good practice to include a -version- statement in each program.
However, if any of the abbreviations are official Stata commands, or
abbreviations thereof, you will get them instead, unless in some
cases you mess with -adopath- (which is emphatically not
recommended).
Nick
[email protected]
Eva Poen wrote:
Is it possible, for a user written command, to link the help file for
-command- to -commandi-? I.e., when typing -help commandi-, what
should show up is the help file for -command-, because it's all
documented in one file.
I came across the *help_alias.maint files in the Stata installation,
which I think do the job for Stata's official commands. I can't see a
way to add aliases (any, really, also abbreviations) for non-official
commands.
I'm forgetful with options, so I get to call the help files for my own
programs from time to time. Combined with my habit of inventing long,
akward names for programs, this is a lot of typing...
Eva
*
* 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/
*
* 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/