A.4   Tcl Procedure Layout

The following conventions define the standard layout for every procedure in a module.

Each procedure is preceded by the procedure documentation, a series of Tcl comments that includes the following blocks. The documentation contains no blank lines, but each block is delimited with a line containing a single pound symbol (#) in the first column.

RETURNS: 
A list of 11 items: vxTicks taskId status priority pc sp errno 
timeout entry priNormal name
If the return value is meaningless enter N/A:

RETURNS: N/A

ERRORS: 
"Cannot find symbol in symbol table"
If no error statement is invoked in the procedure, enter N/A.

ERRORS: N/A

The procedure documentation ends with an empty Tcl comment starting in column one.

The procedure declaration follows the procedure heading and is separated from the documentation block by a single blank line. The format of the procedure and parameter declarations is shown in A.6 Declaration Formats.

The following is an example of a standard procedure layout.

Example A-3:  Standard Tcl Procedure Layout

##################################################################### 
# 
# browse - browse an object, given its ID 
# 
# This routine is bound to the "Show" button, and is invoked when 
# that button is clicked.  If the argument (the contents of... 
# 
# SYNOPSIS 
# .tS 
# browse [objAddr | symbol | &symbol] 
# .tE 
# 
# PARAMETERS 
# .IP <objAddr> 
# the address of an object to browse 
# .IP <symbol> 
# a symbolic address whose contents is the address of 
# an object to browse 
# .IP <&symbol> 
# a symbolic address that is the address of an object to browse 
# 
# RETURNS: N/A 
# 
# ERRORS: N/A 
#
proc browse {args} { ... }