⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eval.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1989-1993 The Regents of the University of California.'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) Eval.3 1.21 97/01/22 14:22:03'\" .so man.macros.TH Tcl_Eval 3 7.0 Tcl "Tcl Library Procedures".BS.SH NAMETcl_Eval, Tcl_VarEval, Tcl_EvalFile, Tcl_GlobalEval \- execute Tcl commands.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.spint\fBTcl_Eval\fR(\fIinterp, cmd\fR).spint\fBTcl_VarEval\fR(\fIinterp, string, string, ... \fB(char *) NULL\fR).spint\fBTcl_EvalFile\fR(\fIinterp, fileName\fR).spint\fBTcl_GlobalEval\fR(\fIinterp, cmd\fR).SH ARGUMENTS.AS Tcl_Interp **termPtr;.AP Tcl_Interp *interp inInterpreter in which to execute the command.A string result will be stored in \fIinterp->result\fR..AP char *cmd inCommand (or sequence of commands) to execute.  Must be in writablememory (\fBTcl_Eval\fR makes temporary modifications to the command)..AP char *string inString forming part of Tcl command..AP char *fileName inName of file containing Tcl command string..BE.SH DESCRIPTION.PPAll four of these procedures execute Tcl commands.\fBTcl_Eval\fR is the core procedure and is used by all the others.It executes the commands in the script held by \fIcmd\fRuntil either an error occurs or it reaches the end of the script..PPNote that \fBTcl_Eval\fR and \fBTcl_GlobalEval\fRhave been largely replaced by theobject-based procedures \fBTcl_EvalObj\fR and \fBTcl_GlobalEvalObj\fR.Those object-based procedures evaluate a script held in a Tcl objectinstead of a string.The object argument can retain the bytecode instructions for the scriptand so avoid reparsing the script each time it is executed.\fBTcl_Eval\fR is implemented using \fBTcl_EvalObj\fRbut is slower because it must reparse the script each timesince there is no object to retain the bytecode instructions..PPThe return value from \fBTcl_Eval\fR is one of the Tcl return codes\fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or\fBTCL_CONTINUE\fR, and \fIinterp->result\fR will point toa string with additional information (a result value or error message).If an error occurs during compilation, this return informationdescribes the error.Otherwise, this return information corresponds to the last commandexecuted from \fIcmd\fR..PP\fBTcl_VarEval\fR takes any number of string argumentsof any length, concatenates them into a single string,then calls \fBTcl_Eval\fR to execute that string as a Tcl command.It returns the result of the command and also modifies\fIinterp->result\fR in the usual fashion for Tcl commands.The last argument to \fBTcl_VarEval\fR must be NULL to indicate the endof arguments..PP\fBTcl_EvalFile\fR reads the file given by \fIfileName\fR and evaluatesits contents as a Tcl command by calling \fBTcl_Eval\fR.  It returnsa standard Tcl result that reflects the result of evaluating the file.If the file couldn't be read then a Tcl error is returned to describewhy the file couldn't be read..PPDuring the processing of a Tcl command it is legal to make nestedcalls to evaluate other commands (this is how procedures andsome control structures are implemented).If a code other than \fBTCL_OK\fR is returnedfrom a nested \fBTcl_Eval\fR invocation,then the caller should normally return immediately,passing that same return code back to its caller,and so on until the top-level application is reached.A few commands, like \fBfor\fR, will check for certainreturn codes, like \fBTCL_BREAK\fR and \fBTCL_CONTINUE\fR, and process themspecially without returning..PP\fBTcl_Eval\fR keeps track of how many nested \fBTcl_Eval\fRinvocations are in progress for \fIinterp\fR.If a code of \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR isabout to be returned from the topmost \fBTcl_Eval\fRinvocation for \fIinterp\fR,it converts the return code to \fBTCL_ERROR\fRand sets \fIinterp->result\fRto point to an error message indicating thatthe \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command wasinvoked in an inappropriate place.This means that top-level applications should never see a return codefrom \fBTcl_Eval\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR..SH "SEE ALSO"Tcl_EvalObj, Tcl_GlobalEvalObj.SH KEYWORDScommand, execute, file, global, object, object result, variable

⌨️ 快捷键说明

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