Stata 15 help for find_hlp_file

Title

[P] find_hlp_file -- Find help file

Syntax

find_hlp_file commandname_or_abbreviation

_findhlpalias commandname_or_abbreviation

Description

find_hlp_file locates the help for commandname_or_abbreviation.

_findhlpalias assists in locating help files associated with commandname_or_abbreviation.

Remarks

The help file associated with commandname_or_abbreviation might be in

commandname_or_abbreviation.sthlp or commandname_or_abbreviation.hlp or somethingelse.sthlp or somethingelse.hlp

The system files ahelp_alias.maint, bhelp_alias.maint, ... zhelp_alias.maint list the aliases. The right way to find the help file associated with `name' is

find_hlp_file `name'

The base name of the help file -- the name without the .sthlp or .hlp suffix -- will be returned in r(result), or an error message will be displayed and r(111) returned.

find_hlp_file is implemented in terms of _findhlpalias. _findhlpalias searches the appropriate .maint file for commandname_or_abbreviation and, if found, returns in r(name) the aliased name. If not found, no error message is displayed and returned is r(111).

Thus, the code for find_hlp_file reads, roughly,

program find_hlp_file, rclass args name

capture which `name'.sthlp if c(rc)==0 { return local result "`name'" exit } capture which `name'.hlp if c(rc)==0 { return local result "`name'" exit } capture _findhlpalias `name' if c(rc)==0 { local alias "`r(name)'" capture which `alias'.sthlp if c(rc)==0 { return local result "`alias'" exit } capture which `alias'.hlp if c(rc)==0 { return local result "`alias'" exit } } display as err "help for `name' not found" exit 111 end

Stored results

find_hlp_file returns in r(result) the base name of the help file without the .sthlp or .hlp suffix. If no help file exists for commandname_or_abbreviation, an error is returned: "help for ___ not found"; r(111).

_findhlpalias returns in r(name) the alias (base name) associated with commandname_or_abbreviation. If there is no alias associated with commandname_or_abbreviation, no error message is displayed, but returned is r(111).


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