################################################################################# Name: xltecho# Purpose: xltecho will echo each element name and it's value from the Source# list of an Xlate.# This can be helpful in debugging complex or lengthy Xlates.# UPoC type: xltp# Args: @xltecho_debug - controls the issuance of debug information# Author: James R. Kosloskey# Date-written: 12/28/1998##*******************************************************************************#* C O D E A U D I T *#*_____________________________________________________________________________*#*Date I-Catcher Description *#*---------- ---------- -------------------------------------------------------*#*12/17/1998 Conception#*_____________________________________________________________________________*#*03/10/2004 jrk031004 Mark module with version number.#* Use string toupper instead of translit.#*_____________________________________________________________________________*#*******************************************************************************## Notes: All data is presented through special variables. The initial# upvar in this proc provides access to the required variables.## This proc style only works when called from a code fragment# within an XLT.################################################################################### Copyright: Copyright(c) 1998, Oakwood Healthcare System. All rights reserved.proc xltecho {} { upvar xlateId xlateId xlateInList xlateInList xlateInTypes xlateInTypes xlateInVals xlateInVals xlateOutList xlateOutList xlateOutTypes xlateOutTypes xlateOutVals xlateOutVals# Global variables global HciConnName# Local variables - initialization# jrk031004 Start set module "XLTECHO v1.1"# jrk031004 End set num_elems "" set list_cnt 0##******************************************************************************************************# Setup the field IDs necessary for this procedure#******************************************************************************************************# set debug_id {@xltecho_debug}; ;# xltecho debug switch##******************************************************************************************************# Setup the Indexes into the Inbound list for the above arguments#******************************************************************************************************# set debug_ndx {} ;# xltecho debug switch index##******************************************************************************************************# Setup the Storage Area for the above arguments#******************************************************************************************************# set debug_sw {N} ;# debug switch##******************************************************************************************************# Get the DEBUG argument# Find the debug argument position if it exists in the inbound list# If it does not exist, notify the invoker# If it does exist, find the value of the switch# Convert a lower case y to upper case#******************************************************************************************************# set debug_ndx [lsearch $xlateInList $debug_id] if {$debug_ndx == -1} { ;# Did we find the argument? echo "$HciConnName $module: Can't find $debug_id - required." set fatal_err 1 ;# Set fatal error switch } else { ;# Found, convert lower case y to upper# jrk031004 Start set debug_sw [string toupper [lindex $xlateInVals $debug_ndx]] ;#Change lower to upper# jrk031004 End } ##******************************************************************************************************# If debug is set display the xlateInList#******************************************************************************************************# if {$debug_sw == "Y"} { echo "$HciConnName $module: *** START *********************************************************************************************" echo "$HciConnName $module: xlateInList >$xlateInList$xlateInVals$num_elems$list_cnt$curr_elem_name$curr_elem_value<." incr list_cnt 1 ;# Increment the pointer } ;#End foreach echo "$HciConnName $module: ------------------------ End ----------------------" } ;# Endif debug} ;# End xltecho