home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
docprocs_add.tcl
< prev
next >
Wrap
Text File
|
1996-12-05
|
2KB
|
50 lines
#
# TCL-procedure: createReports name_list
#
# The createReports procedure creates local sections which will allow
# inclusion of actual reports in a document.
# The argument name_list is a , sepperated list of report names without
# the .tcl suffix for example: classes, events. storeFile and section
# are pre-defined given by the environment. Also global $document is set.
#
proc createReport { name_list storeFile section } {
# Prepare path_names
set M4repdir [path_name concat [m4_var get M4_home] reports]
set M4bindir [path_name concat [m4_var get M4_home] bin]
# use the ClientContext to switch systems
set cc [ClientContext::global]
# remember the current document-system we are in now
set currsys [$cc currentSystem]
# get the system handle of the system we are documenting now
# the document object is a global set var in docbatch.tcl
set docsys [$document docSys]
# Change the context to the system to execute the report in
$cc changeLevelId $docsys
# Set the first indent level to indent +
set indent +
# open the file in where the sub-structure will be generated
set fid [open $storeFile w]
# For each report name in the name_list run the (TCLbased) report-writer
foreach name [split $name_list " "] {
set name [string trim $name]
set tmpname [args_file {}]
puts "Executing TCL report writer for report $name.tcl"
system "$M4bindir/otsh -f $M4repdir/startreport.tcl -- $name.tcl > $tmpname"
# Now generate the additional structure lines note that the section
# name - must - differ from the name used in the .str file, e.g.
# the new section name must be unique. We use the the report name.
puts $fid "$name|$indent||DocText||$tmpname"
set indent =
}
# Close the sub-structure file
close $fid
# Go back to the context fo the current document system
$cc changeLevelId $currsys
}