info(n) Tcl Built-In Commands info(n) _________________________________________________________________ NAME info - Return information about the state of the Tcl inter- preter SYNOPSIS info _o_p_t_i_o_n ?_a_r_g _a_r_g ...? _________________________________________________________________ DESCRIPTION This command provides information about various internals of the Tcl interpreter. The legal _o_p_t_i_o_n's (which may be abbreviated) are: info args _p_r_o_c_n_a_m_e Returns a list containing the names of the arguments to procedure _p_r_o_c_n_a_m_e, in order. _P_r_o_c_n_a_m_e must be the name of a Tcl command procedure. info body _p_r_o_c_n_a_m_e Returns the body of procedure _p_r_o_c_n_a_m_e. _P_r_o_c_n_a_m_e must be the name of a Tcl command procedure. info cmdcount Returns a count of the total number of commands that have been invoked in this interpreter. info commands ?_p_a_t_t_e_r_n? If _p_a_t_t_e_r_n isn't specified, returns a list of names of all the Tcl commands, including both the built-in com- mands written in C and the command procedures defined using the proc command. If _p_a_t_t_e_r_n is specified, only those names matching _p_a_t_t_e_r_n are returned. Matching is determined using the same rules as for string match. info complete _c_o_m_m_a_n_d Returns 1 if _c_o_m_m_a_n_d is a complete Tcl command in the sense of having no unclosed quotes, braces, brackets or array element names, If the command doesn't appear to be complete then 0 is returned. This command is typi- cally used in line-oriented input environments to allow users to type in commands that span multiple lines; if the command isn't complete, the script can delay evaluating it until additional lines have been typed to complete the command. info default _p_r_o_c_n_a_m_e _a_r_g _v_a_r_n_a_m_e _P_r_o_c_n_a_m_e must be the name of a Tcl command procedure and _a_r_g must be the name of an argument to that pro- cedure. If _a_r_g doesn't have a default value then the Tcl Last change: 7.5 1 info(n) Tcl Built-In Commands info(n) command returns 0. Otherwise it returns 1 and places the default value of _a_r_g into variable _v_a_r_n_a_m_e. info exists _v_a_r_N_a_m_e Returns 1 if the variable named _v_a_r_N_a_m_e exists in the current context (either as a global or local variable), returns 0 otherwise. info globals ?_p_a_t_t_e_r_n? If _p_a_t_t_e_r_n isn't specified, returns a list of all the names of currently-defined global variables. If _p_a_t_- _t_e_r_n is specified, only those names matching _p_a_t_t_e_r_n are returned. Matching is determined using the same rules as for string match. info hostname Returns the name of the computer on which this invoca- tion is being executed. info level ?_n_u_m_b_e_r? If _n_u_m_b_e_r is not specified, this command returns a number giving the stack level of the invoking pro- cedure, or 0 if the command is invoked at top-level. If _n_u_m_b_e_r is specified, then the result is a list con- sisting of the name and arguments for the procedure call at level _n_u_m_b_e_r on the stack. If _n_u_m_b_e_r is posi- tive then it selects a particular stack level (1 refers to the top-most active procedure, 2 to the procedure it called, and so on); otherwise it gives a level relative to the current level (0 refers to the current pro- cedure, -1 to its caller, and so on). See the uplevel command for more information on what stack levels mean. info library Returns the name of the library directory in which standard Tcl scripts are stored. This is actually the value of the tcl_library variable and may be changed by setting tcl_library. See the tclvars manual entry for more information. info loaded ?_i_n_t_e_r_p? Returns a list describing all of the packages that have been loaded into _i_n_t_e_r_p with the load command. Each list element is a sub-list with two elements consisting of the name of the file from which the package was loaded and the name of the package. For statically- loaded packages the file name will be an empty string. If _i_n_t_e_r_p is omitted then information is returned for all packages loaded in any interpreter in the process. To get a list of just the packages in the current interpreter, specify an empty string for the _i_n_t_e_r_p argument. Tcl Last change: 7.5 2 info(n) Tcl Built-In Commands info(n) info locals ?_p_a_t_t_e_r_n? If _p_a_t_t_e_r_n isn't specified, returns a list of all the names of currently-defined local variables, including arguments to the current procedure, if any. Variables defined with the global and upvar commands will not be returned. If _p_a_t_t_e_r_n is specified, only those names matching _p_a_t_t_e_r_n are returned. Matching is determined using the same rules as for string match. info nameofexecutable Returns the full path name of the binary file from which the application was invoked. If Tcl was unable to identify the file, then an empty string is returned. info patchlevel Returns the value of the global variable tcl_patchLevel; see the tclvars manual entry for more information. info procs ?_p_a_t_t_e_r_n? If _p_a_t_t_e_r_n isn't specified, returns a list of all the names of Tcl command procedures. If _p_a_t_t_e_r_n is speci- fied, only those names matching _p_a_t_t_e_r_n are returned. Matching is determined using the same rules as for string match. info script If a Tcl script file is currently being evaluated (i.e. there is a call to Tcl_EvalFile active or there is an active invocation of the source command), then this command returns the name of the innermost file being processed. Otherwise the command returns an empty string. info sharedlibextension Returns the extension used on this platform for the names of files containing shared libraries (for exam- ple, .so under Solaris). If shared libraries aren't supported on this platform then an empty string is returned. info tclversion Returns the value of the global variable tcl_version; see the tclvars manual entry for more information. info vars ?_p_a_t_t_e_r_n? If _p_a_t_t_e_r_n isn't specified, returns a list of all the names of currently-visible variables, including both locals and currently-visible globals. If _p_a_t_t_e_r_n is specified, only those names matching _p_a_t_t_e_r_n are returned. Matching is determined using the same rules as for string match. Tcl Last change: 7.5 3 info(n) Tcl Built-In Commands info(n) KEYWORDS command, information, interpreter, level, procedure, vari- able Tcl Last change: 7.5 4