📄 x-codetcl3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Tcl Coding Conventions </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="x-codetcl.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-codetcl.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-codetcl2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-codetcl4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84387">A.3 Tcl Module Layout</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84390"> </a>A <i class="term">module</i> is any unit of code that resides in a single Tcl file. The conventions in this section define the standard module heading that must come at the beginning of every Tcl module following the standard file heading. The module heading consists of the blocks described below; the blocks are separated by one or more blank lines.</p><dd><p class="Body"><a name="84391"> </a>After the modification history and before the first function or executable code of the module, the following sections are included in the following order, if appropriate:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84392"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"><b class="hb">General Module Documentation:</b></font> The module documentation is a block of single-line Tcl comments beginning by the keyword <i class="i">DESCRIPTION</i> and consisting of a complete description of the overall module purpose and function, especially the external interface. The description includes the heading <i class="term">RESOURCE FILES</i> followed by a list of relevant Tcl files sourced inside the file.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84393"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"><b class="hb">Globals:</b></font> The globals block consists of a one-line Tcl comment containing the word <i class="title">globals</i> followed by one or more Tcl declarations, one per line. This block groups together all declarations in the module that are intended to be visible outside the module.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84394"> </a>The format of these blocks is shown in the following example (which also includes the Tcl version of the file heading):</p></dl></dl><h4 class="EntityTitle"><a name="84395"><font face="Helvetica, sans-serif" size="-1" class="sans">Example A-2: Tcl File and Module Headings</font></a></h4><dl class="margin"><dl class="margin"><dd><pre class="Code"><b><a name="84396"># Browser.tcl - Browser Tcl implementation file # # Copyright 1994-1995 Wind River Systems, Inc. # # modification history # -------------------- # 02b,30oct95,jco added About menu and source browser.tcl in .wind. # 02a,02sep95,pad fixed communications loss with license daemon (SPR #1234). # 01c,05mar95,jcf upgraded spy dialog # 01b,08feb95,p_m take care of loadFlags in wtxObjModuleInfoGet. # 01a,06dec94,c_s written. # # DESCRIPTION # This module is the Tcl code for the browser. It creates the main window and # initializes the objects in it, such as the task list and memory charts. # # RESOURCE FILES # wpwr/host/resource/tcl/shelbrws.tcl # wpwr/host/resource/tcl/app-config/Browser/*.tcl # ... #*/ # globals set browserUpdate 0 ;# no auto update by default</a></b></pre></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="x-codetcl.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-codetcl.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-codetcl2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-codetcl4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -