02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

B.3.1 Tcl Module Layout<br />

A module is any unit of code that resides in a single Tcl file. The conventions in this<br />

section define the standard module heading that must come at the beginning of<br />

every Tcl module following the standard file heading. The module heading<br />

consists of the blocks described below; the blocks are separated by one or more<br />

blank lines.<br />

After the modification history and before the first function or executable code of<br />

the module, the following sections are included in the following order, if<br />

appropriate:<br />

■<br />

General Module Documentation: The module documentation is a block of<br />

single-line Tcl comments beginning by the keyword DESCRIPTION and<br />

consisting of a complete description of the overall module purpose and<br />

function, especially the external interface. The description includes the<br />

heading RESOURCE FILES followed by a list of relevant Tcl files sourced<br />

inside the file.<br />

■<br />

Globals: The globals block consists of a one-line Tcl comment containing the<br />

word globals followed by one or more Tcl declarations, one per line. This block<br />

groups together all declarations in the module that are intended to be visible<br />

outside the module.<br />

The format of these blocks is shown in the following example (which also includes<br />

the Tcl version of the file heading):<br />

Example B-1<br />

Tcl File and Module Headings<br />

# Browser.tcl - Browser Tcl implementation file<br />

#<br />

# Copyright 1994-1995 Wind River Systems, Inc.<br />

#<br />

# modification history<br />

# --------------------<br />

# 02b,30oct95,jco added About menu and source browser.tcl in .wind.<br />

# 02a,02sep95,pad fixed communications loss with license daemon (SPR #1234).<br />

# 01c,05mar95,jcf upgraded spy dialog<br />

# 01b,08feb95,p_m take care of loadFlags in wtxObjModuleInfoGet.<br />

# 01a,06dec94,c_s written.<br />

#<br />

# DESCRIPTION<br />

# This module is the Tcl code for the browser. It creates the main window and<br />

# initializes the objects in it, such as the task list and memory charts.<br />

#<br />

# RESOURCE FILES<br />

# wpwr/host/resource/tcl/shelbrws.tcl<br />

# wpwr/host/resource/tcl/app-config/Browser/*.tcl<br />

# ...<br />

326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!