home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / doc / info.n < prev    next >
Text File  |  1993-06-18  |  7KB  |  163 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/info.n,v 1.2 93/06/18 13:58:33 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS info tcl 7.0
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. info \- Return information about the state of the Tcl interpreter
  29. .SH SYNOPSIS
  30. \fBinfo \fIoption \fR?\fIarg arg ...\fR?
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. This command provides information about various internals of the Tcl
  36. interpreter.
  37. The legal \fIoption\fR's (which may be abbreviated) are:
  38. .TP
  39. \fBinfo args \fIprocname\fR
  40. Returns a list containing the names of the arguments to procedure
  41. \fIprocname\fR, in order.  \fIProcname\fR must be the name of a
  42. Tcl command procedure.
  43. .TP
  44. \fBinfo body \fIprocname\fR
  45. Returns the body of procedure \fIprocname\fR.  \fIProcname\fR must be
  46. the name of a Tcl command procedure.
  47. .TP
  48. \fBinfo cmdcount\fR
  49. Returns a count of the total number of commands that have been invoked
  50. in this interpreter.
  51. .TP
  52. \fBinfo commands \fR?\fIpattern\fR?
  53. If \fIpattern\fR isn't specified, returns a list of names of all the
  54. Tcl commands, including both the built-in commands written in C and
  55. the command procedures defined using the \fBproc\fR command.
  56. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  57. are returned.  Matching is determined using the same rules as for
  58. \fBstring match\fR.
  59. .TP
  60. \fBinfo complete \fIcommand\fR
  61. Returns 1 if \fIcommand\fR is a complete Tcl command in the sense of
  62. having no unclosed quotes, braces, brackets or array element names,
  63. If the command doesn't appear to be complete then 0 is returned.
  64. This command is typically used in line-oriented input environments
  65. to allow users to type in commands that span multiple lines;  if the
  66. command isn't complete, the script can delay evaluating it until additional
  67. lines have been typed to complete the command.
  68. .TP
  69. \fBinfo default \fIprocname arg varname\fR
  70. \fIProcname\fR must be the name of a Tcl command procedure and \fIarg\fR
  71. must be the name of an argument to that procedure.  If \fIarg\fR
  72. doesn't have a default value then the command returns \fB0\fR.
  73. Otherwise it returns \fB1\fR and places the default value of \fIarg\fR
  74. into variable \fIvarname\fR.
  75. .TP
  76. \fBinfo exists \fIvarName\fR
  77. Returns \fB1\fR if the variable named \fIvarName\fR exists in the
  78. current context (either as a global or local variable), returns \fB0\fR
  79. otherwise.
  80. .TP
  81. \fBinfo globals \fR?\fIpattern\fR?
  82. If \fIpattern\fR isn't specified, returns a list of all the names
  83. of currently-defined global variables.
  84. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  85. are returned.  Matching is determined using the same rules as for
  86. \fBstring match\fR.
  87. .TP
  88. \fBinfo level\fR ?\fInumber\fR?
  89. If \fInumber\fR is not specified, this command returns a number
  90. giving the stack level of the invoking procedure, or 0 if the
  91. command is invoked at top-level.  If \fInumber\fR is specified,
  92. then the result is a list consisting of the name and arguments for the
  93. procedure call at level \fInumber\fR on the stack.  If \fInumber\fR
  94. is positive then it selects a particular stack level (1 refers
  95. to the top-most active procedure, 2 to the procedure it called, and
  96. so on); otherwise it gives a level relative to the current level
  97. (0 refers to the current procedure, -1 to its caller, and so on).
  98. See the \fBuplevel\fR command for more information on what stack
  99. levels mean.
  100. .TP
  101. \fBinfo library\fR
  102. Returns the name of the library directory in which standard Tcl
  103. scripts are stored.
  104. The default value for the library is compiled into Tcl, but it
  105. may be overridden by setting the TCL_LIBRARY environment variable.
  106. If there is no TCL_LIBRARY variable and no compiled-in value then
  107. and error is generated.
  108. See the \fBlibrary\fR manual entry for details of the facilities
  109. provided by the Tcl script library.
  110. Normally each application will have its own application-specific
  111. script library in addition to the Tcl script library;  I suggest that
  112. each application set a global variable with a name like
  113. \fB$\fIapp\fB_library\fR (where \fIapp\fR is the application's name)
  114. to hold the location of that application's library directory.
  115. .TP
  116. \fBinfo locals \fR?\fIpattern\fR?
  117. If \fIpattern\fR isn't specified, returns a list of all the names
  118. of currently-defined local variables, including arguments to the
  119. current procedure, if any.
  120. Variables defined with the \fBglobal\fR and \fBupvar\fR commands
  121. will not be returned.
  122. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  123. are returned.  Matching is determined using the same rules as for
  124. \fBstring match\fR.
  125. .TP
  126. \fBinfo patchlevel\fR
  127. .VS
  128. Returns a decimal integer giving the current patch level for Tcl.
  129. The patch level is incremented for each new release or patch, and
  130. it uniquely identifies an official version of Tcl.
  131. .VE
  132. .TP
  133. \fBinfo procs \fR?\fIpattern\fR?
  134. If \fIpattern\fR isn't specified, returns a list of all the
  135. names of Tcl command procedures.
  136. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  137. are returned.  Matching is determined using the same rules as for
  138. \fBstring match\fR.
  139. .TP
  140. \fBinfo script\fR
  141. If a Tcl script file is currently being evaluated (i.e. there is a
  142. call to \fBTcl_EvalFile\fR active or there is an active invocation
  143. of the \fBsource\fR command), then this command returns the name
  144. of the innermost file being processed.  Otherwise the command returns an
  145. empty string.
  146. .TP
  147. \fBinfo tclversion\fR
  148. Returns the version number for this version of Tcl in the form \fIx.y\fR,
  149. where changes to \fIx\fR represent major changes with probable
  150. incompatibilities and changes to \fIy\fR represent small enhancements and
  151. bug fixes that retain backward compatibility.
  152. .TP
  153. \fBinfo vars\fR ?\fIpattern\fR?
  154. If \fIpattern\fR isn't specified,
  155. returns a list of all the names of currently-visible variables, including
  156. both locals and currently-visible globals.
  157. If \fIpattern\fR is specified, only those names matching \fIpattern\fR
  158. are returned.  Matching is determined using the same rules as for
  159. \fBstring match\fR.
  160.  
  161. .SH KEYWORDS
  162. command, information, interpreter, level, procedure, variable
  163.