x-codetcl6.html

来自「vxworks相关论文」· HTML 代码 · 共 86 行

HTML
86
字号
<!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-codetcl5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-codetcl7.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="84436">A.6  &nbsp;&nbsp;Declaration Formats</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84438"> </a>Include only one declaration per line. Declarations are indented in accordance with <a href="x-codetcl7.html#84477"><i class="title">Indentation</i></a>, and begin at the current indentation level. The remainder of this section describes the declaration formats for variables and procedures.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84442">Variables</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84443"> </a>For global variables, the Tcl <b class="command">set</b> command appears first on the line, separated from the identifier by a tab character. Complete the declaration with a meaningful comment at the end of the same line. Variables, values, and comments should be aligned, as in the following example:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="84444">set&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rootMemNBytes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;;# memory for TCB and root stack set&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rootTaskId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;;# root task ID set&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;symSortByName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;;# boolean for alphabetical sort</a></b></pre></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84445">Procedures</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84447"> </a>The procedure name and list of parameters appear on the first line, followed by the opening curly brace. The declarations of global variables used inside the procedure begin on the next line, one on each separate line. The rest of the procedure code begins after a blank line. For example:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="84448">proc lstFind {list node} {     global firstNode     global lastNode      ... }</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-codetcl5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-codetcl7.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 + =
减小字号Ctrl + -
显示快捷键?