📄 4.html
字号:
<HTML><TITLE>Procedures</TITLE><BODY BGCOLOR="#FFF0E0" VLINK="#0FBD0F" TEXT="#101000" LINK="#0F0FDD">
<A NAME="top"><H1>Procedures</H1>
<P> At first glance, Tcl procedures are pretty standard. Procedure invocations
have arguments that match up with parameters declared in procedure
implementations. Namespaces for variables are different when procedures are
executing than before they are invoked. Such local variable namespaces are
destroyed when their procedures finish executing. Namespaces for procedures,
on the other hand, are global. A procedure named <TT>p</TT> can be referenced
anyplace that the same Tcl interpreter controls. (There is one exception
to this described below in
Action Families.)
<P> Beyond these common features, Tcl procedures have their own peculiarities.
They can be reimplemented on the fly. The way they access and manipulate
values of nonlocal variables is unique. These are topics you must
master before you can program well in Tcl.
<P> However, idiomatic Tcl/Tk programming involves more, it involves the
way you fit multiple actions into single procedures. That topic, too,
is covered in this chapter – your more complex scripts should take
advantage of it.
<P> Procedures are so important and the nuances of using them are so many
that the discussion of them continues with Chapter 9 and briefly
with Section 5.7.
<UL>
<LI>
Procedures
<LI>
Global and Local Variables
<LI>
Passing Arguments by Reference
<LI>
Default Values for Parameters
<LI>
Reimplementing Procedures
<LI>
Regional Variables
<LI>
Action Families
<LI>
An Example Action Family
<LI>
Implementing Action Families in Earlier Versions of Tcl
<LI>
Error Handling
<LI>
<CITE>Procedures Defining Procedures</CITE>
<LI>
Solutions to Exercises
</UL>
<!-- Linkbar -->
<P><CENTER><FONT SIZE=2><NOBR>
<STRONG>From</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/sbf/tcl/book/home.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/sbf/tcl/book/home.html'" tppabs="http://www.mapfree.com/sbf/tcl/book/home.html">Tcl/Tk For Programmers</A><WBR>
<STRONG>Previous</STRONG>
<A HREF="3.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/3.html">chapter</A><WBR>
<STRONG>Next</STRONG>
<A HREF="5.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/5.html">chapter</A><WBR>
<STRONG>All</STRONG>
<A HREF="Contents.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/Contents.html">chapters</A><WBR>
<STRONG>Author</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/mp/jaz/home.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/mp/jaz/home.html'" tppabs="http://www.mapfree.com/mp/jaz/home.html">J. A. Zimmer</A><WBR>
<STRONG>Copyright</STRONG>
<A HREF="copyright.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/copyright.html">Notice</A><WBR>
<P>
<I>Jun 17, 1998</I>
</NOBR></FONT></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -