Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | '\" |
2 | '\" Copyright (c) 1993 The Regents of the University of California. | |
3 | '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. | |
4 | '\" | |
5 | '\" See the file "license.terms" for information on usage and redistribution | |
6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. | |
7 | '\" | |
8 | '\" RCS: @(#) $Id: tclvars.n,v 1.13.2.2 2004/11/16 10:07:00 dkf Exp $ | |
9 | '\" | |
10 | '\" The definitions below are for supplemental macros used in Tcl/Tk | |
11 | '\" manual entries. | |
12 | '\" | |
13 | '\" .AP type name in/out ?indent? | |
14 | '\" Start paragraph describing an argument to a library procedure. | |
15 | '\" type is type of argument (int, etc.), in/out is either "in", "out", | |
16 | '\" or "in/out" to describe whether procedure reads or modifies arg, | |
17 | '\" and indent is equivalent to second arg of .IP (shouldn't ever be | |
18 | '\" needed; use .AS below instead) | |
19 | '\" | |
20 | '\" .AS ?type? ?name? | |
21 | '\" Give maximum sizes of arguments for setting tab stops. Type and | |
22 | '\" name are examples of largest possible arguments that will be passed | |
23 | '\" to .AP later. If args are omitted, default tab stops are used. | |
24 | '\" | |
25 | '\" .BS | |
26 | '\" Start box enclosure. From here until next .BE, everything will be | |
27 | '\" enclosed in one large box. | |
28 | '\" | |
29 | '\" .BE | |
30 | '\" End of box enclosure. | |
31 | '\" | |
32 | '\" .CS | |
33 | '\" Begin code excerpt. | |
34 | '\" | |
35 | '\" .CE | |
36 | '\" End code excerpt. | |
37 | '\" | |
38 | '\" .VS ?version? ?br? | |
39 | '\" Begin vertical sidebar, for use in marking newly-changed parts | |
40 | '\" of man pages. The first argument is ignored and used for recording | |
41 | '\" the version when the .VS was added, so that the sidebars can be | |
42 | '\" found and removed when they reach a certain age. If another argument | |
43 | '\" is present, then a line break is forced before starting the sidebar. | |
44 | '\" | |
45 | '\" .VE | |
46 | '\" End of vertical sidebar. | |
47 | '\" | |
48 | '\" .DS | |
49 | '\" Begin an indented unfilled display. | |
50 | '\" | |
51 | '\" .DE | |
52 | '\" End of indented unfilled display. | |
53 | '\" | |
54 | '\" .SO | |
55 | '\" Start of list of standard options for a Tk widget. The | |
56 | '\" options follow on successive lines, in four columns separated | |
57 | '\" by tabs. | |
58 | '\" | |
59 | '\" .SE | |
60 | '\" End of list of standard options for a Tk widget. | |
61 | '\" | |
62 | '\" .OP cmdName dbName dbClass | |
63 | '\" Start of description of a specific option. cmdName gives the | |
64 | '\" option's name as specified in the class command, dbName gives | |
65 | '\" the option's name in the option database, and dbClass gives | |
66 | '\" the option's class in the option database. | |
67 | '\" | |
68 | '\" .UL arg1 arg2 | |
69 | '\" Print arg1 underlined, then print arg2 normally. | |
70 | '\" | |
71 | '\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $ | |
72 | '\" | |
73 | '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. | |
74 | .if t .wh -1.3i ^B | |
75 | .nr ^l \n(.l | |
76 | .ad b | |
77 | '\" # Start an argument description | |
78 | .de AP | |
79 | .ie !"\\$4"" .TP \\$4 | |
80 | .el \{\ | |
81 | . ie !"\\$2"" .TP \\n()Cu | |
82 | . el .TP 15 | |
83 | .\} | |
84 | .ta \\n()Au \\n()Bu | |
85 | .ie !"\\$3"" \{\ | |
86 | \&\\$1 \\fI\\$2\\fP (\\$3) | |
87 | .\".b | |
88 | .\} | |
89 | .el \{\ | |
90 | .br | |
91 | .ie !"\\$2"" \{\ | |
92 | \&\\$1 \\fI\\$2\\fP | |
93 | .\} | |
94 | .el \{\ | |
95 | \&\\fI\\$1\\fP | |
96 | .\} | |
97 | .\} | |
98 | .. | |
99 | '\" # define tabbing values for .AP | |
100 | .de AS | |
101 | .nr )A 10n | |
102 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n | |
103 | .nr )B \\n()Au+15n | |
104 | .\" | |
105 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n | |
106 | .nr )C \\n()Bu+\\w'(in/out)'u+2n | |
107 | .. | |
108 | .AS Tcl_Interp Tcl_CreateInterp in/out | |
109 | '\" # BS - start boxed text | |
110 | '\" # ^y = starting y location | |
111 | '\" # ^b = 1 | |
112 | .de BS | |
113 | .br | |
114 | .mk ^y | |
115 | .nr ^b 1u | |
116 | .if n .nf | |
117 | .if n .ti 0 | |
118 | .if n \l'\\n(.lu\(ul' | |
119 | .if n .fi | |
120 | .. | |
121 | '\" # BE - end boxed text (draw box now) | |
122 | .de BE | |
123 | .nf | |
124 | .ti 0 | |
125 | .mk ^t | |
126 | .ie n \l'\\n(^lu\(ul' | |
127 | .el \{\ | |
128 | .\" Draw four-sided box normally, but don't draw top of | |
129 | .\" box if the box started on an earlier page. | |
130 | .ie !\\n(^b-1 \{\ | |
131 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
132 | .\} | |
133 | .el \}\ | |
134 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
135 | .\} | |
136 | .\} | |
137 | .fi | |
138 | .br | |
139 | .nr ^b 0 | |
140 | .. | |
141 | '\" # VS - start vertical sidebar | |
142 | '\" # ^Y = starting y location | |
143 | '\" # ^v = 1 (for troff; for nroff this doesn't matter) | |
144 | .de VS | |
145 | .if !"\\$2"" .br | |
146 | .mk ^Y | |
147 | .ie n 'mc \s12\(br\s0 | |
148 | .el .nr ^v 1u | |
149 | .. | |
150 | '\" # VE - end of vertical sidebar | |
151 | .de VE | |
152 | .ie n 'mc | |
153 | .el \{\ | |
154 | .ev 2 | |
155 | .nf | |
156 | .ti 0 | |
157 | .mk ^t | |
158 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' | |
159 | .sp -1 | |
160 | .fi | |
161 | .ev | |
162 | .\} | |
163 | .nr ^v 0 | |
164 | .. | |
165 | '\" # Special macro to handle page bottom: finish off current | |
166 | '\" # box/sidebar if in box/sidebar mode, then invoked standard | |
167 | '\" # page bottom macro. | |
168 | .de ^B | |
169 | .ev 2 | |
170 | 'ti 0 | |
171 | 'nf | |
172 | .mk ^t | |
173 | .if \\n(^b \{\ | |
174 | .\" Draw three-sided box if this is the box's first page, | |
175 | .\" draw two sides but no top otherwise. | |
176 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
177 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
178 | .\} | |
179 | .if \\n(^v \{\ | |
180 | .nr ^x \\n(^tu+1v-\\n(^Yu | |
181 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c | |
182 | .\} | |
183 | .bp | |
184 | 'fi | |
185 | .ev | |
186 | .if \\n(^b \{\ | |
187 | .mk ^y | |
188 | .nr ^b 2 | |
189 | .\} | |
190 | .if \\n(^v \{\ | |
191 | .mk ^Y | |
192 | .\} | |
193 | .. | |
194 | '\" # DS - begin display | |
195 | .de DS | |
196 | .RS | |
197 | .nf | |
198 | .sp | |
199 | .. | |
200 | '\" # DE - end display | |
201 | .de DE | |
202 | .fi | |
203 | .RE | |
204 | .sp | |
205 | .. | |
206 | '\" # SO - start of list of standard options | |
207 | .de SO | |
208 | .SH "STANDARD OPTIONS" | |
209 | .LP | |
210 | .nf | |
211 | .ta 5.5c 11c | |
212 | .ft B | |
213 | .. | |
214 | '\" # SE - end of list of standard options | |
215 | .de SE | |
216 | .fi | |
217 | .ft R | |
218 | .LP | |
219 | See the \\fBoptions\\fR manual entry for details on the standard options. | |
220 | .. | |
221 | '\" # OP - start of full description for a single option | |
222 | .de OP | |
223 | .LP | |
224 | .nf | |
225 | .ta 4c | |
226 | Command-Line Name: \\fB\\$1\\fR | |
227 | Database Name: \\fB\\$2\\fR | |
228 | Database Class: \\fB\\$3\\fR | |
229 | .fi | |
230 | .IP | |
231 | .. | |
232 | '\" # CS - begin code excerpt | |
233 | .de CS | |
234 | .RS | |
235 | .nf | |
236 | .ta .25i .5i .75i 1i | |
237 | .. | |
238 | '\" # CE - end code excerpt | |
239 | .de CE | |
240 | .fi | |
241 | .RE | |
242 | .. | |
243 | .de UL | |
244 | \\$1\l'|0\(ul'\\$2 | |
245 | .. | |
246 | .TH tclvars n 8.0 Tcl "Tcl Built-In Commands" | |
247 | .BS | |
248 | '\" Note: do not modify the .SH NAME line immediately below! | |
249 | .SH NAME | |
250 | tclvars \- Variables used by Tcl | |
251 | .BE | |
252 | ||
253 | .SH DESCRIPTION | |
254 | .PP | |
255 | The following global variables are created and managed automatically | |
256 | by the Tcl library. Except where noted below, these variables should | |
257 | normally be treated as read-only by application-specific code and by users. | |
258 | .TP | |
259 | \fBenv\fR | |
260 | This variable is maintained by Tcl as an array | |
261 | whose elements are the environment variables for the process. | |
262 | Reading an element will return the value of the corresponding | |
263 | environment variable. | |
264 | Setting an element of the array will modify the corresponding | |
265 | environment variable or create a new one if it doesn't already | |
266 | exist. | |
267 | Unsetting an element of \fBenv\fR will remove the corresponding | |
268 | environment variable. | |
269 | Changes to the \fBenv\fR array will affect the environment | |
270 | passed to children by commands like \fBexec\fR. | |
271 | If the entire \fBenv\fR array is unset then Tcl will stop | |
272 | monitoring \fBenv\fR accesses and will not update environment | |
273 | variables. | |
274 | .RS | |
275 | .VS 8.0 | |
276 | Under Windows, the environment variables PATH and COMSPEC in any | |
277 | capitalization are converted automatically to upper case. For instance, the | |
278 | PATH variable could be exported by the operating system as ``path'', | |
279 | ``Path'', ``PaTh'', etc., causing otherwise simple Tcl code to have to | |
280 | support many special cases. All other environment variables inherited by | |
281 | Tcl are left unmodified. Setting an env array variable to blank is the | |
282 | same as unsetting it as this is the behavior of the underlying Windows OS. | |
283 | It should be noted that relying on an existing and empty environment variable | |
284 | won't work on windows and is discouraged for cross-platform usage. | |
285 | .VE | |
286 | .RE | |
287 | .RS | |
288 | On the Macintosh, the environment variable is constructed by Tcl as no | |
289 | global environment variable exists. The environment variables that | |
290 | are created for Tcl include: | |
291 | .TP | |
292 | \fBLOGIN\fR | |
293 | This holds the Chooser name of the Macintosh. | |
294 | .TP | |
295 | \fBUSER\fR | |
296 | This also holds the Chooser name of the Macintosh. | |
297 | .TP | |
298 | \fBSYS_FOLDER\fR | |
299 | The path to the system directory. | |
300 | .TP | |
301 | \fBAPPLE_M_FOLDER\fR | |
302 | The path to the Apple Menu directory. | |
303 | .TP | |
304 | \fBCP_FOLDER\fR | |
305 | The path to the control panels directory. | |
306 | .TP | |
307 | \fBDESK_FOLDER\fR | |
308 | The path to the desk top directory. | |
309 | .TP | |
310 | \fBEXT_FOLDER\fR | |
311 | The path to the system extensions directory. | |
312 | .TP | |
313 | \fBPREF_FOLDER\fR | |
314 | The path to the preferences directory. | |
315 | .TP | |
316 | \fBPRINT_MON_FOLDER\fR | |
317 | The path to the print monitor directory. | |
318 | .TP | |
319 | \fBSHARED_TRASH_FOLDER\fR | |
320 | The path to the network trash directory. | |
321 | .TP | |
322 | \fBTRASH_FOLDER\fR | |
323 | The path to the trash directory. | |
324 | .TP | |
325 | \fBSTART_UP_FOLDER\fR | |
326 | The path to the start up directory. | |
327 | .TP | |
328 | \fBHOME\fR | |
329 | The path to the application's default directory. | |
330 | .PP | |
331 | You can also create your own environment variables for the Macintosh. | |
332 | A file named \fITcl Environment Variables\fR may be placed in the | |
333 | preferences folder in the Mac system folder. Each line of this file | |
334 | should be of the form \fIVAR_NAME=var_data\fR. | |
335 | .PP | |
336 | The last alternative is to place environment variables in a 'STR#' | |
337 | resource named \fITcl Environment Variables\fR of the application. This | |
338 | is considered a little more ``Mac like'' than a Unix style Environment | |
339 | Variable file. Each entry in the 'STR#' resource has the same format | |
340 | as above. The source code file \fItclMacEnv.c\fR contains the | |
341 | implementation of the env mechanisms. This file contains many | |
342 | #define's that allow customization of the env mechanisms to fit your | |
343 | applications needs. | |
344 | .RE | |
345 | .TP | |
346 | \fBerrorCode\fR | |
347 | After an error has occurred, this variable will be set to hold | |
348 | additional information about the error in a form that is easy | |
349 | to process with programs. | |
350 | \fBerrorCode\fR consists of a Tcl list with one or more elements. | |
351 | The first element of the list identifies a general class of | |
352 | errors, and determines the format of the rest of the list. | |
353 | The following formats for \fBerrorCode\fR are used by the | |
354 | Tcl core; individual applications may define additional formats. | |
355 | .RS | |
356 | .TP | |
357 | \fBARITH\fI code msg\fR | |
358 | This format is used when an arithmetic error occurs (e.g. an attempt | |
359 | to divide by zero in the \fBexpr\fR command). | |
360 | \fICode\fR identifies the precise error and \fImsg\fR provides a | |
361 | human-readable description of the error. \fICode\fR will be either | |
362 | DIVZERO (for an attempt to divide by zero), | |
363 | DOMAIN (if an argument is outside the domain of a function, such as acos(\-3)), | |
364 | IOVERFLOW (for integer overflow), | |
365 | OVERFLOW (for a floating-point overflow), | |
366 | or UNKNOWN (if the cause of the error cannot be determined). | |
367 | .TP | |
368 | \fBCHILDKILLED\fI pid sigName msg\fR | |
369 | This format is used when a child process has been killed because of | |
370 | a signal. The second element of \fBerrorCode\fR will be the | |
371 | process's identifier (in decimal). | |
372 | The third element will be the symbolic name of the signal that caused | |
373 | the process to terminate; it will be one of the names from the | |
374 | include file signal.h, such as \fBSIGPIPE\fR. | |
375 | The fourth element will be a short human-readable message | |
376 | describing the signal, such as ``write on pipe with no readers'' | |
377 | for \fBSIGPIPE\fR. | |
378 | .TP | |
379 | \fBCHILDSTATUS\fI pid code\fR | |
380 | This format is used when a child process has exited with a non-zero | |
381 | exit status. The second element of \fBerrorCode\fR will be the | |
382 | process's identifier (in decimal) and the third element will be the exit | |
383 | code returned by the process (also in decimal). | |
384 | .TP | |
385 | \fBCHILDSUSP\fI pid sigName msg\fR | |
386 | This format is used when a child process has been suspended because | |
387 | of a signal. | |
388 | The second element of \fBerrorCode\fR will be the process's identifier, | |
389 | in decimal. | |
390 | The third element will be the symbolic name of the signal that caused | |
391 | the process to suspend; this will be one of the names from the | |
392 | include file signal.h, such as \fBSIGTTIN\fR. | |
393 | The fourth element will be a short human-readable message | |
394 | describing the signal, such as ``background tty read'' | |
395 | for \fBSIGTTIN\fR. | |
396 | .TP | |
397 | \fBNONE\fR | |
398 | This format is used for errors where no additional information is | |
399 | available for an error besides the message returned with the | |
400 | error. In these cases \fBerrorCode\fR will consist of a list | |
401 | containing a single element whose contents are \fBNONE\fR. | |
402 | .TP | |
403 | \fBPOSIX \fIerrName msg\fR | |
404 | If the first element of \fBerrorCode\fR is \fBPOSIX\fR, then | |
405 | the error occurred during a POSIX kernel call. | |
406 | The second element of the list will contain the symbolic name | |
407 | of the error that occurred, such as \fBENOENT\fR; this will | |
408 | be one of the values defined in the include file errno.h. | |
409 | The third element of the list will be a human-readable | |
410 | message corresponding to \fIerrName\fR, such as | |
411 | ``no such file or directory'' for the \fBENOENT\fR case. | |
412 | .PP | |
413 | To set \fBerrorCode\fR, applications should use library | |
414 | procedures such as \fBTcl_SetErrorCode\fR and \fBTcl_PosixError\fR, | |
415 | or they may invoke the \fBerror\fR command. | |
416 | If one of these methods hasn't been used, then the Tcl | |
417 | interpreter will reset the variable to \fBNONE\fR after | |
418 | the next error. | |
419 | .RE | |
420 | .TP | |
421 | \fBerrorInfo\fR | |
422 | After an error has occurred, this string will contain one or more lines | |
423 | identifying the Tcl commands and procedures that were being executed | |
424 | when the most recent error occurred. | |
425 | Its contents take the form of a stack trace showing the various | |
426 | nested Tcl commands that had been invoked at the time of the error. | |
427 | .TP | |
428 | \fBtcl_library\fR | |
429 | This variable holds the name of a directory containing the | |
430 | system library of Tcl scripts, such as those used for auto-loading. | |
431 | The value of this variable is returned by the \fBinfo library\fR command. | |
432 | See the \fBlibrary\fR manual entry for details of the facilities | |
433 | provided by the Tcl script library. | |
434 | Normally each application or package will have its own application-specific | |
435 | script library in addition to the Tcl script library; | |
436 | each application should set a global variable with a name like | |
437 | \fB$\fIapp\fB_library\fR (where \fIapp\fR is the application's name) | |
438 | to hold the network file name for that application's library directory. | |
439 | The initial value of \fBtcl_library\fR is set when an interpreter | |
440 | is created by searching several different directories until one is | |
441 | found that contains an appropriate Tcl startup script. | |
442 | If the \fBTCL_LIBRARY\fR environment variable exists, then | |
443 | the directory it names is checked first. | |
444 | If \fBTCL_LIBRARY\fR isn't set or doesn't refer to an appropriate | |
445 | directory, then Tcl checks several other directories based on a | |
446 | compiled-in default location, the location of the binary containing | |
447 | the application, and the current working directory. | |
448 | .TP | |
449 | \fBtcl_patchLevel\fR | |
450 | When an interpreter is created Tcl initializes this variable to | |
451 | hold a string giving the current patch level for Tcl, such as | |
452 | \fB7.3p2\fR for Tcl 7.3 with the first two official patches, or | |
453 | \fB7.4b4\fR for the fourth beta release of Tcl 7.4. | |
454 | The value of this variable is returned by the \fBinfo patchlevel\fR | |
455 | command. | |
456 | .VS 8.0 br | |
457 | .TP | |
458 | \fBtcl_pkgPath\fR | |
459 | This variable holds a list of directories indicating where packages are | |
460 | normally installed. It is not used on Windows. It typically contains | |
461 | either one or two entries; if it contains two entries, the first is | |
462 | normally a directory for platform-dependent packages (e.g., shared library | |
463 | binaries) and the second is normally a directory for platform-independent | |
464 | packages (e.g., script files). Typically a package is installed as a | |
465 | subdirectory of one of the entries in \fB$tcl_pkgPath\fR. The directories | |
466 | in \fB$tcl_pkgPath\fR are included by default in the \fBauto_path\fR | |
467 | variable, so they and their immediate subdirectories are automatically | |
468 | searched for packages during \fBpackage require\fR commands. Note: | |
469 | \fBtcl_pkgPath\fR it not intended to be modified by the application. Its | |
470 | value is added to \fBauto_path\fR at startup; changes to \fBtcl_pkgPath\fR | |
471 | are not reflected in \fBauto_path\fR. If you want Tcl to search additional | |
472 | directories for packages you should add the names of those directories to | |
473 | \fBauto_path\fR, not \fBtcl_pkgPath\fR. | |
474 | .VE | |
475 | .TP | |
476 | \fBtcl_platform\fR | |
477 | This is an associative array whose elements contain information about | |
478 | the platform on which the application is running, such as the name of | |
479 | the operating system, its current release number, and the machine's | |
480 | instruction set. The elements listed below will always | |
481 | be defined, but they may have empty strings as values if Tcl couldn't | |
482 | retrieve any relevant information. In addition, extensions | |
483 | and applications may add additional values to the array. The | |
484 | predefined elements are: | |
485 | .RS | |
486 | .VS | |
487 | .TP | |
488 | \fBbyteOrder\fR | |
489 | The native byte order of this machine: either \fBlittleEndian\fR or | |
490 | \fBbigEndian\fR. | |
491 | .VE | |
492 | .TP | |
493 | \fBdebug\fR | |
494 | If this variable exists, then the interpreter was compiled with and linked | |
495 | to a debug-enabled C run-time. This variable will only exist on Windows, | |
496 | so extension writers can specify which package to load depending on the | |
497 | C run-time library that is in use. This is not an indication that this core | |
498 | contains symbols. | |
499 | .TP | |
500 | \fBmachine\fR | |
501 | The instruction set executed by this machine, such as | |
502 | \fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR. On UNIX machines, this | |
503 | is the value returned by \fBuname -m\fR. | |
504 | .TP | |
505 | \fBos\fR | |
506 | The name of the operating system running on this machine, | |
507 | such as \fBWindows 95\fR, \fBWindows NT\fR, \fBMacOS\fR, or \fBSunOS\fR. | |
508 | On UNIX machines, this is the value returned by \fBuname -s\fR. | |
509 | On Windows 95 and Windows 98, the value returned will be \fBWindows | |
510 | 95\fR to provide better backwards compatibility to Windows 95; to | |
511 | distinguish between the two, check the \fBosVersion\fR. | |
512 | .TP | |
513 | \fBosVersion\fR | |
514 | The version number for the operating system running on this machine. | |
515 | On UNIX machines, this is the value returned by \fBuname -r\fR. On | |
516 | Windows 95, the version will be 4.0; on Windows 98, the version will | |
517 | be 4.10. | |
518 | .TP | |
519 | \fBplatform\fR | |
520 | Either \fBwindows\fR, \fBmacintosh\fR, or \fBunix\fR. This identifies the | |
521 | general operating environment of the machine. | |
522 | .TP | |
523 | \fBthreaded\fR | |
524 | If this variable exists, then the interpreter | |
525 | was compiled with threads enabled. | |
526 | .TP | |
527 | \fBuser\fR | |
528 | This identifies the | |
529 | current user based on the login information available on the platform. | |
530 | This comes from the USER or LOGNAME environment variable on Unix, | |
531 | and the value from GetUserName on Windows and Macintosh. | |
532 | .TP | |
533 | \fBwordSize\fR | |
534 | .VS 8.4 | |
535 | This gives the size of the native-machine word in bytes (strictly, it | |
536 | is same as the result of evaluating \fIsizeof(long)\fR in C.) | |
537 | .VE 8.4 | |
538 | .RE | |
539 | .TP | |
540 | \fBtcl_precision\fR | |
541 | .VS | |
542 | This variable controls the number of digits to generate | |
543 | when converting floating-point values to strings. It defaults | |
544 | to 12. | |
545 | 17 digits is ``perfect'' for IEEE floating-point in that it allows | |
546 | double-precision values to be converted to strings and back to | |
547 | binary with no loss of information. However, using 17 digits prevents | |
548 | any rounding, which produces longer, less intuitive results. For example, | |
549 | \fBexpr 1.4\fR returns 1.3999999999999999 with \fBtcl_precision\fR | |
550 | set to 17, vs. 1.4 if \fBtcl_precision\fR is 12. | |
551 | .RS | |
552 | All interpreters in a process share a single \fBtcl_precision\fR value: | |
553 | changing it in one interpreter will affect all other interpreters as | |
554 | well. However, safe interpreters are not allowed to modify the | |
555 | variable. | |
556 | .RE | |
557 | .VE | |
558 | .TP | |
559 | \fBtcl_rcFileName\fR | |
560 | This variable is used during initialization to indicate the name of a | |
561 | user-specific startup file. If it is set by application-specific | |
562 | initialization, then the Tcl startup code will check for the existence | |
563 | of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR | |
564 | the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR | |
565 | for Windows. | |
566 | .TP | |
567 | \fBtcl_rcRsrcName\fR | |
568 | This variable is only used on Macintosh systems. The variable is used | |
569 | during initialization to indicate the name of a user-specific | |
570 | \fBTEXT\fR resource located in the application or extension resource | |
571 | forks. If it is set by application-specific initialization, then the | |
572 | Tcl startup code will check for the existence of this resource and | |
573 | \fBsource\fR it if it exists. For example, the Macintosh \fBwish\fR | |
574 | application has the variable is set to \fBtclshrc\fR. | |
575 | .TP | |
576 | \fBtcl_traceCompile\fR | |
577 | The value of this variable can be set to control | |
578 | how much tracing information | |
579 | is displayed during bytecode compilation. | |
580 | By default, tcl_traceCompile is zero and no information is displayed. | |
581 | Setting tcl_traceCompile to 1 generates a one-line summary in stdout | |
582 | whenever a procedure or top-level command is compiled. | |
583 | Setting it to 2 generates a detailed listing in stdout of the | |
584 | bytecode instructions emitted during every compilation. | |
585 | This variable is useful in | |
586 | tracking down suspected problems with the Tcl compiler. | |
587 | It is also occasionally useful when converting | |
588 | existing code to use Tcl8.0. | |
589 | .PP | |
590 | This variable and functionality only exist if | |
591 | \fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation. | |
592 | .TP | |
593 | \fBtcl_traceExec\fR | |
594 | The value of this variable can be set to control | |
595 | how much tracing information | |
596 | is displayed during bytecode execution. | |
597 | By default, tcl_traceExec is zero and no information is displayed. | |
598 | Setting tcl_traceExec to 1 generates a one-line trace in stdout | |
599 | on each call to a Tcl procedure. | |
600 | Setting it to 2 generates a line of output | |
601 | whenever any Tcl command is invoked | |
602 | that contains the name of the command and its arguments. | |
603 | Setting it to 3 produces a detailed trace showing the result of | |
604 | executing each bytecode instruction. | |
605 | Note that when tcl_traceExec is 2 or 3, | |
606 | commands such as \fBset\fR and \fBincr\fR | |
607 | that have been entirely replaced by a sequence | |
608 | of bytecode instructions are not shown. | |
609 | Setting this variable is useful in | |
610 | tracking down suspected problems with the bytecode compiler | |
611 | and interpreter. | |
612 | It is also occasionally useful when converting | |
613 | code to use Tcl8.0. | |
614 | .PP | |
615 | This variable and functionality only exist if | |
616 | \fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation. | |
617 | .TP | |
618 | \fBtcl_wordchars\fR | |
619 | The value of this variable is a regular expression that can be set to | |
620 | control what are considered ``word'' characters, for instances like | |
621 | selecting a word by double-clicking in text in Tk. It is platform | |
622 | dependent. On Windows, it defaults to \fB\\S\fR, meaning anything | |
623 | but a Unicode space character. Otherwise it defaults to \fB\\w\fR, | |
624 | which is any Unicode word character (number, letter, or underscore). | |
625 | .TP | |
626 | \fBtcl_nonwordchars\fR | |
627 | The value of this variable is a regular expression that can be set to | |
628 | control what are considered ``non-word'' characters, for instances like | |
629 | selecting a word by double-clicking in text in Tk. It is platform | |
630 | dependent. On Windows, it defaults to \fB\\s\fR, meaning any Unicode space | |
631 | character. Otherwise it defaults to \fB\\W\fR, which is anything but a | |
632 | Unicode word character (number, letter, or underscore). | |
633 | .TP | |
634 | \fBtcl_version\fR | |
635 | When an interpreter is created Tcl initializes this variable to | |
636 | hold the version number for this version of Tcl in the form \fIx.y\fR. | |
637 | Changes to \fIx\fR represent major changes with probable | |
638 | incompatibilities and changes to \fIy\fR represent small enhancements and | |
639 | bug fixes that retain backward compatibility. | |
640 | The value of this variable is returned by the \fBinfo tclversion\fR | |
641 | command. | |
642 | .SH "OTHER GLOBAL VARIABLES" | |
643 | The following variables are only guaranteed to exist in \fBtclsh\fR | |
644 | and \fBwish\fR executables; the Tcl library does not define them | |
645 | itself but many Tcl environments do. | |
646 | .TP 6 | |
647 | \fBargc\fR | |
648 | The number of arguments to \fBtclsh\fR or \fBwish\fR. | |
649 | .TP 6 | |
650 | \fBargv\fR | |
651 | Tcl list of arguments to \fBtclsh\fR or \fBwish\fR. | |
652 | .TP 6 | |
653 | \fBargv0\fR | |
654 | The script that \fBtclsh\fR or \fBwish\fR started executing (if it was | |
655 | specified) or otherwise the name by which \fBtclsh\fR or \fBwish\fR | |
656 | was invoked. | |
657 | .TP 6 | |
658 | \fBtcl_interactive\fR | |
659 | Contains 1 if \fBtclsh\fR or \fBwish\fR is running interactively (no | |
660 | script was specified and standard input is a terminal-like device), 0 | |
661 | otherwise. | |
662 | .PP | |
663 | The \fBwish\fR executably additionally specifies the following global | |
664 | variable: | |
665 | .TP 6 | |
666 | \fBgeometry\fR | |
667 | If set, contains the user-supplied geometry specification to use for | |
668 | the main Tk window. | |
669 | ||
670 | .SH "SEE ALSO" | |
671 | eval(n), tclsh(1), wish(1) | |
672 | ||
673 | .SH KEYWORDS | |
674 | arithmetic, bytecode, compiler, error, environment, POSIX, precision, subprocess, variables |