tclvars.n

来自「tcl是工具命令语言」· N 代码 · 共 413 行 · 第 1/2 页

N
413
字号
the directory it names is checked first.If \fBTCL_LIBRARY\fR isn't set or doesn't refer to an appropriatedirectory, then Tcl checks several other directories based on acompiled-in default location, the location of the binary containingthe application, and the current working directory..TP\fBtcl_patchLevel\fRWhen an interpreter is created Tcl initializes this variable tohold a string giving the current patch level for Tcl, such as\fB7.3p2\fR for Tcl 7.3 with the first two official patches, or\fB7.4b4\fR for the fourth beta release of Tcl 7.4.The value of this variable is returned by the \fBinfo patchlevel\fRcommand..VS 8.0 br.TP\fBtcl_pkgPath\fRThis variable holds a list of directories indicating where packages arenormally installed.  It is not used on Windows.  It typically containseither one or two entries; if it contains two entries, the first isnormally a directory for platform-dependent packages (e.g., shared librarybinaries) and the second is normally a directory for platform-independentpackages (e.g., script files). Typically a package is installed as asubdirectory of one of the entries in \fB$tcl_pkgPath\fR. The directoriesin \fB$tcl_pkgPath\fR are included by default in the \fBauto_path\fRvariable, so they and their immediate subdirectories are automaticallysearched for packages during \fBpackage require\fR commands.  Note:\fBtcl_pkgPath\fR it not intended to be modified by the application.  Itsvalue is added to \fBauto_path\fR at startup; changes to \fBtcl_pkgPath\fRare not reflected in \fBauto_path\fR.  If you want Tcl to search additionaldirectories for packages you should add the names of those directories to\fBauto_path\fR, not \fBtcl_pkgPath\fR..VE.TP\fBtcl_platform\fRThis is an associative array whose elements contain information aboutthe platform on which the application is running, such as the name ofthe operating system, its current release number, and the machine'sinstruction set.  The elements listed below will alwaysbe defined, but they may have empty strings as values if Tcl couldn'tretrieve any relevant information.  In addition, extensionsand applications may add additional values to the array.  Thepredefined elements are:.RS.VS.TP\fBbyteOrder\fRThe native byte order of this machine: either \fBlittleEndian\fR or\fBbigEndian\fR. .VE.TP\fBdebug\fRIf this variable exists, then the interpreterwas compiled with debugging symbols enabled.  This variable will onlyexist on Windows so extension writers can specify which package to loaddepending on the C run-time library that is loaded..TP\fBmachine\fRThe instruction set executed by this machine, such as\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR.  On UNIX machines, thisis the value returned by \fBuname -m\fR..TP\fBos\fR The name of the operating system running on this machine,such as \fBWindows 95\fR, \fBWindows NT\fR, \fBMacOS\fR, or \fBSunOS\fR.On UNIX machines, this is the value returned by \fBuname -s\fR.On Windows 95 and Windows 98, the value returned will be \fBWindows95\fR to provide better backwards compatibility to Windows 95; todistinguish between the two, check the \fBosVersion\fR..TP\fBosVersion\fRThe version number for the operating system running on this machine.On UNIX machines, this is the value returned by \fBuname -r\fR.  OnWindows 95, the version will be 4.0; on Windows 98, the version willbe 4.10..TP\fBplatform\fREither \fBwindows\fR, \fBmacintosh\fR, or \fBunix\fR.  This identifies thegeneral operating environment of the machine..TP\fBthreaded\fRIf this variable exists, then the interpreterwas compiled with threads enabled..TP\fBuser\fRThis identifies thecurrent user based on the login information available on the platform.This comes from the USER or LOGNAME environment variable on Unix,and the value from GetUserName on Windows and Macintosh..TP\fBwordSize\fR.VS 8.4This gives the size of the native-machine word in bytes (strictly, itis same as the result of evaluating \fIsizeof(long)\fR in C.).VE 8.4.RE.TP\fBtcl_precision\fR.VSThis variable controls the number of digits to generatewhen converting floating-point values to strings.  It defaultsto 12.17 digits is ``perfect'' for IEEE floating-point in that it allowsdouble-precision values to be converted to strings and back tobinary with no loss of information.  However, using 17 digits preventsany rounding, which produces longer, less intuitive results.  For example,\fBexpr 1.4\fR returns 1.3999999999999999 with \fBtcl_precision\fRset to 17, vs. 1.4 if \fBtcl_precision\fR is 12..RSAll interpreters in a process share a single \fBtcl_precision\fR value:changing it in one interpreter will affect all other interpreters aswell.  However, safe interpreters are not allowed to modify thevariable..RE.VE.TP\fBtcl_rcFileName\fRThis variable is used during initialization to indicate the name of auser-specific startup file.  If it is set by application-specificinitialization, then the Tcl startup code will check for the existenceof this file and \fBsource\fR it if it exists.  For example, for \fBwish\fRthe variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fRfor Windows..TP\fBtcl_rcRsrcName\fRThis variable is only used on Macintosh systems.  The variable is usedduring initialization to indicate the name of a user-specific\fBTEXT\fR resource located in the application or extension resourceforks.  If it is set by application-specific initialization, then theTcl startup code will check for the existence of this resource and\fBsource\fR it if it exists.  For example, the Macintosh \fBwish\fRapplication has the variable is set to \fBtclshrc\fR..TP\fBtcl_traceCompile\fRThe value of this variable can be set to controlhow much tracing informationis displayed during bytecode compilation.By default, tcl_traceCompile is zero and no information is displayed.Setting tcl_traceCompile to 1 generates a one line summary in stdoutwhenever a procedure or top level command is compiled.Setting it to 2 generates a detailed listing in stdout of thebytecode instructions emitted during every compilation.This variable is useful intracking down suspected problems with the Tcl compiler.It is also occasionally useful when convertingexisting code to use Tcl8.0.This variable and functionality only exist ifTCL_COMPILE_DEBUG was defined during Tcl's compilation..TP\fBtcl_traceExec\fRThe value of this variable can be set to controlhow much tracing informationis displayed during bytecode execution.By default, tcl_traceExec is zero and no information is displayed.Setting tcl_traceExec to 1 generates a one line trace in stdouton each call to a Tcl procedure.Setting it to 2 generates a line of outputwhenever any Tcl command is invokedthat contains the name of the command and its arguments.Setting it to 3 produces a detailed trace showing the result ofexecuting each bytecode instruction.Note that when tcl_traceExec is 2 or 3,commands such as set and incrthat have been entirely replaced by a sequenceof bytecode instructions are not shown.Setting this variable is useful intracking down suspected problems with the bytecode compilerand interpreter.It is also occasionally useful when convertingcode to use Tcl8.0.This variable and functionality only exist ifTCL_COMPILE_DEBUG was defined during Tcl's compilation..TP\fBtcl_wordchars\fRThe value of this variable is a regular expression that can be set tocontrol what are considered ``word'' characters, for instances likeselecting a word by double-clicking in text in Tk.  It is platformdependent.  On Windows, it defaults to \fB\\S\fR, meaning anythingbut a Unicode space character.  Otherwise it defaults to \fB\\w\fR,which is any Unicode word character (number, letter, or underscore)..TP\fBtcl_nonwordchars\fRThe value of this variable is a regular expression that can be set tocontrol what are considered ``non-word'' characters, for instances likeselecting a word by double-clicking in text in Tk.  It is platformdependent.  On Windows, it defaults to \fB\\s\fR, meaning any Unicode spacecharacter.  Otherwise it defaults to \fB\\W\fR, which is anything but aUnicode word character (number, letter, or underscore)..TP\fBtcl_version\fRWhen an interpreter is created Tcl initializes this variable tohold the version number for this version of Tcl in the form \fIx.y\fR.Changes to \fIx\fR represent major changes with probableincompatibilities and changes to \fIy\fR represent small enhancements andbug fixes that retain backward compatibility.The value of this variable is returned by the \fBinfo tclversion\fRcommand..SH "SEE ALSO"eval(n).SH KEYWORDSarithmetic, bytecode, compiler, error, environment, POSIX, precision, subprocess, variables

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?