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

📄 proc.n

📁 linux系统下的音频通信
💻 N
字号:
'\"'\" Copyright (c) 1993 The Regents of the University of California.'\" Copyright (c) 1994-1996 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: @(#) proc.n 1.6 97/05/18 15:49:45'\" .so man.macros.TH proc n "" Tcl "Tcl Built-In Commands".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEproc \- Create a Tcl procedure.SH SYNOPSIS\fBproc \fIname args body\fR.BE.SH DESCRIPTION.PPThe \fBproc\fR command creates a new Tcl procedure named\fIname\fR, replacingany existing command or procedure there may have been by that name.Whenever the new command is invoked, the contents of \fIbody\fR willbe executed by the Tcl interpreter.Normally, \fIname\fR is unqualified(does not include the names of any containing namespaces),and the new procedure is created in the current namespace.If \fIname\fR includes any namespace qualifiers,the procedure is created in the specified namespace.\fIArgs\fR specifies the formal arguments to theprocedure.  It consists of a list, possibly empty, each of whoseelements specifiesone argument.  Each argument specifier is also a list with eitherone or two fields.  If there is only a single field in the specifierthen it is the name of the argument; if there are two fields, thenthe first is the argument name and the second is its default value..PPWhen \fIname\fR is invoked a local variablewill be created for each of the formal arguments to the procedure; itsvalue will be the value of corresponding argument in the invoking commandor the argument's default value.Arguments with default values need not bespecified in a procedure invocation.  However, there must be enoughactual arguments for all theformal arguments that don't have defaults, and there must not be any extraactual arguments.  There is one special case to permit procedures withvariable numbers of arguments.  If the last formal argument has the name\fBargs\fR, then a call to the procedure may contain more actual argumentsthan the procedure has formals.  In this case, all of the actual argumentsstarting at the one that would be assigned to \fBargs\fR are combined intoa list (as if the \fBlist\fR command had been used); this combined valueis assigned to the local variable \fBargs\fR..PPWhen \fIbody\fR is being executed, variable names normally refer tolocal variables, which are created automatically when referenced anddeleted when the procedure returns.  One local variable is automaticallycreated for each of the procedure's arguments.Global variables can only be accessed by invokingthe \fBglobal\fR command or the \fBupvar\fR command.Namespace variables can only be accessed by invokingthe \fBvariable\fR command or the \fBupvar\fR command..PPThe \fBproc\fR command returns an empty string.  When a procedure isinvoked, the procedure's return value is the value specified in a\fBreturn\fR command.  If the procedure doesn't execute an explicit\fBreturn\fR, then its return value is the value of the last commandexecuted in the procedure's body.If an error occurs while executing the procedurebody, then the procedure-as-a-whole will return that same error..SH KEYWORDSargument, procedure

⌨️ 快捷键说明

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