home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / languages / tcl / !tcldoc / doc / RiscOS / tclvars < prev   
Encoding:
Text File  |  1996-01-17  |  4.3 KB  |  110 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/tclvars.n,v 1.1 93/06/16 16:52:49 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS tclvars tcl
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. tclvars \- Variables used by Tcl
  29. .BE
  30.  
  31. .SH DESCRIPTION
  32. .PP
  33. The following global variables are created and managed automatically
  34. by the Tcl library.  Except where noted below, these variables should
  35. normally be treated as read-only by application-specific code and by users.
  36. .TP
  37. \fBenv\fR
  38. .br
  39. This variable is implemented in the library file \fBenv\fR using
  40. the \fBgetenv\fR and \fBsystem\fR procedures if the file is included
  41. using \fB source <Tcl$Dir>.library.env \fR.
  42. This variable is maintained by Tcl as an array
  43. whose elements are the system variables.
  44. Reading an element will return the value of the corresponding
  45. system variable.
  46. Setting an element of the array will modify the corresponding
  47. system variable or create a new one if it doesn't already
  48. exist.
  49. Unsetting an element of \fBenv\fR will remove the corresponding
  50. system variable.
  51. .TP
  52. \fBerrorCode\fR
  53. After an error has occurred, this variable will be set to hold
  54. additional information about the error in a form that is easy
  55. to process with programs.
  56. \fBerrorCode\fR consists of a Tcl list with one or more elements.
  57. The first element of the list identifies a general class of
  58. errors, and determines the format of the rest of the list.
  59. The following formats for \fBerrorCode\fR are used by the
  60. Tcl core; individual applications may define additional formats.
  61. .RS
  62. .TP
  63. \fBARITH\fI code msg\fR
  64. .VS
  65. This format is used when an arithmetic error occurs (e.g. an attempt
  66. to divide by zero in the \fBexpr\fR command).
  67. \fICode\fR identifies the precise error and \fImsg\fR provides a
  68. human-readable description of the error.  \fICode\fR will be either
  69. DIVZERO (for an attempt to divide by zero),
  70. DOMAIN (if an argument is outside the domain of a function, such as acos(\-3)),
  71. IOVERFLOW (for integer overflow),
  72. OVERLFLOW (for a floating-point overflow),
  73. or UNKNOWN (if the cause of the error cannot be determined).
  74. .VE
  75. .TP
  76. \fBNONE\fR
  77. .br
  78. This format is used for errors where no additional information is
  79. available for an error besides the message returned with the
  80. error.  In these cases \fBerrorCode\fR will consist of a list
  81. containing a single element whose contents are \fBNONE\fR.
  82. .RE
  83. .TP
  84. \fBerrorInfo\fR
  85. After an error has occurred, this string will contain one or more lines
  86. identifying the Tcl commands and procedures that were being executed
  87. when the most recent error occurred.
  88. Its contents take the form of a stack trace showing the various
  89. nested Tcl commands that had been invoked at the time of the error.
  90. .TP
  91. \fBtcl_precision\fR
  92. .VS
  93. If this variable is set, it must contain a decimal number giving the
  94. number of significant digits to include when converting floating-point
  95. values to strings.
  96. If this variable is not set then 6 digits are included.
  97. 17 digits is ``perfect'' for IEEE floating-point in that it allows
  98. double-precision values to be converted to strings and back to
  99. binary with no loss of precision.
  100. .VE
  101.  
  102. .TP
  103. \fBclock\fR
  104. This returns the time in centiseconds since the program was started
  105. .TP
  106. \fBrand\fR
  107. This returns a random integer in the range  0 to 2147483647
  108. .SH KEYWORDS
  109. arithmetic, error, environment,precision, variables
  110.