Stata 11 help for which

help which -------------------------------------------------------------------------------

Title

[R] which -- Display location and version of an ado-file

Syntax

which fname[.ftype] [, all]

Description

which looks for file fname.ftype along the S_ADO path. If Stata finds the file, which displays the full path and filename, along with, if the file is ASCII, all lines in the file that begin with "*!" in the first column. If Stata cannot find the file, which issues the message "file not found along path" and sets the return code to 111. ftype must be a file type for which Stata usually looks along the ado-path to find it. Allowable ftypes are

.ado, .class, .dlg, idlg, .sthlp, .ihlp, .hlp, .key, .maint, .mata, .mlib, .mo, .mnu, .plugin, .scheme, and .style

If ftype is omitted, which assumes .ado. When searching for .ado files, if Stata cannot find the file, Stata then checks to see if fname is a built-in Stata command, allowing for valid abbreviations. If it is, a message "built-in command" is displayed; if not, the message "command not found as either built-in or ado-file" is displayed and the return code is set to 111.

For information on internal version control, see [P] version.

Option

all forces which to report the location of all files matching the fname.ftype found along the search path. The default is to report just the first one found.

Example

If we type which command, where command is a built-in command rather than an ado-file, Stata responds with

. which summarize built-in command: summarize

If command was neither a built-in command nor an ado-file, Stata would respond with

. which junk command junk not found as either built-in or ado-file r(111);

Also see

Manual: [R] which

Help: [P] findfile, [P] version


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