Here is the sub-proc that does the call to the external program uudeview.exe:
proc decodePDF {} {
# Use uudeview.exe to decode the string
# it is located in “E:quovadxqdx5.3integratortcluudeview”
# Temporarily change the working directory to “E:quovadxqdx5.3integrator”
# so that the uuDecoded PDF is written there
# After the decode reset the working directory back
#
puts stdout “nproc decodePDF running”
upvar 1 myName myVar ; # Needed in case we get an error
set currPath [pwd] ; # Save the current default path (directory)
set wrkPath [file join “E:/” “quovadx” “qdx5.3” “integrator”]
# The exec command runs the DOS program uudeview.exe,
# the -i option is not interactive
# the -c option is clean up after (delete encoded file after it is decoded)
# The catch command is used to capture errors if any and
# allow an orderly shutdown of the script.
# First change the working directory to where we want the PDF
#
cd $wrkPath
set status [catch {exec — {E:\quovadx\qdx5.3\integrator\tcl\uudeview\uudeview.exe} {-i} {-c} {E:\quovadx\qdx5.3\integrator\tcl\uudeview\cnvStr.uue}} res2]
# Reset the working directory
cd $currPath
puts stdout “status: $status”
puts stdout “result2: $res2”
if {$status != 1} {
puts stdout “n$myVar: Call to uudeview failed! $res2”
return 1
} else {
return 0
}
} ; # end of decodePDF
Yes I wait for this to complete, before executing the next statement.